Re: [CMake] Some minor issues for 2.6.0-RC-8

2008-04-22 Thread Hendrik Sattler

Zitat von "Miguel A. Figueroa-Villanueva" <[EMAIL PROTECTED]>:


On Fri, Apr 18, 2008 at 10:35 AM, Bill Hoffman wrote:

Alan W. Irwin wrote:
> (1) In FindwxWidgets.cmake, wxWidgets_LIBRARIES is documented as
> "Path to the wxWidgets libraries".  From the above result (before my macro
> transformed it) this documentation should be changed to something like
> "List of linker options to use when linking to the wxWidgets libraries".

 Can the FindwxWidgets.cmake maintainer take a look at this?  I think the
issue is that pkg-config is used.  So, on windows where it is not used then
that statement is correct.


I'm sorry for the late reply... but yes Bill is right. On Windows, we
look for the libraries with some find_library magic and this statement
is correct. On linux, it uses `wx-config --libs` output which is a
list of linker options.

Maybe, I should document it as:

wxWidgets_LIBRARIES - Path to the wxWidgets libraries in windows. For
unix style it includes a list of linker options.


Actually, the Module should be fixed instead to do the documented  
thing. Like pkg-config, the wx-config output should be properly  
post-processed.


HS


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Change standart VC Linker (link.exe)

2008-04-22 Thread Ivan Chupahin
Hi, everyone!
I once wrote here about problem of change VS linker link.exe to other
linker, may be now someone can help solve it?

I try to change linker like that:
STRING(REPLACE "${CMAKE_CXX_COMPILER}" "someotherlinker.exe"
CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE})
But it`s not work.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Alan W. Irwin

On 2008-04-22 21:48-0400 Amitha Perera wrote:


Horacio Sanson wrote:

The problem is that in linux I have to add the sctp library (i.e.
-lsctp) if not compilation fails and in FreeBSD adding that library
would cause the compiler to complain.

if there is a better way to do this I am eager to learn it.


Not necessarily "better", but if sctp exists on Linux, but not on FreeBSD (or 
more generally, if sctp should be linked against whenever it is found), an 
option is


find_library( SCTP_LIBRARY sctp )

target_link_libraries( your_exec ${SCTP_LIBRARY} )


Good idea, but I believe you would also need the following modification to
the above logic

find_library( SCTP_LIBRARY sctp )
if(SCTP_LIBRARY)
  target_link_libraries( your_exec ${SCTP_LIBRARY} )
endif(SCTP_LIBRARY)

The reason for the extra logic is that if libsctp is not found then
SCTP_LIBRARY with be set to "SCTP_LIBRARY-NOTFOUND" which would screw up 
"target_link_libraries" without the "if" protection.


Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Amitha Perera

Horacio Sanson wrote:

The problem is that in linux I have to add the sctp library (i.e.
-lsctp) if not compilation fails and in FreeBSD adding that library
would cause the compiler to complain.

if there is a better way to do this I am eager to learn it.


Not necessarily "better", but if sctp exists on Linux, but not on 
FreeBSD (or more generally, if sctp should be linked against whenever it 
is found), an option is


find_library( SCTP_LIBRARY sctp )

target_link_libraries( your_exec ${SCTP_LIBRARY} )


cmake --help-command find_library should be helpful.

Cheers,
Amitha.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Some minor issues for 2.6.0-RC-8

2008-04-22 Thread Miguel A. Figueroa-Villanueva
On Fri, Apr 18, 2008 at 10:35 AM, Bill Hoffman wrote:
> Alan W. Irwin wrote:
> > (1) In FindwxWidgets.cmake, wxWidgets_LIBRARIES is documented as
> > "Path to the wxWidgets libraries".  From the above result (before my macro
> > transformed it) this documentation should be changed to something like
> > "List of linker options to use when linking to the wxWidgets libraries".
>
>  Can the FindwxWidgets.cmake maintainer take a look at this?  I think the
> issue is that pkg-config is used.  So, on windows where it is not used then
> that statement is correct.

I'm sorry for the late reply... but yes Bill is right. On Windows, we
look for the libraries with some find_library magic and this statement
is correct. On linux, it uses `wx-config --libs` output which is a
list of linker options.

Maybe, I should document it as:

wxWidgets_LIBRARIES - Path to the wxWidgets libraries in windows. For
unix style it includes a list of linker options.

Comments?

--Miguel
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake and distutils

2008-04-22 Thread Alan W. Irwin

On 2008-04-22 20:06+0200 Christophe Alexandre wrote:


Hi all,

I'm working on a C++ project exporting its API with in Python.
Is there an "easy..." way to compile and generate the Python Modules with 
cmake.
I find the the distutils and cmake hard to use together : not the same build 
management, the installation process,...

Wouldn't it be better to compile the Python Modules only with cmake ?

If anyone has some experience on the subject, I'll be happy to hear from it.


PLplot historically has chosen to use autotools and now cmake to build our
swig-generated (and also one hand-crafted instance) of python bindings to
our C library.  The method works well. Although we don't use distutils for
the actual build, it is quite useful for finding out things about the python
environment that we need to know for the build.

To see the full example, look at cmake/modules/python.cmake (which finds out
everything we need to know about python) and bindings/python/CMakeList.txt
(for the module build and install), and examples/python/CMakeList.txt (for
examples that use the built python interface to PLplot) in
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CHECK_FUNCTION_EXISTS question

2008-04-22 Thread Eric Noulard
2008/4/22, Mathieu Malaterre <[EMAIL PROTECTED]>:
> Hi there,
>
>   If I understand correctly CHECK_FUNCTION_EXISTS is only checking
>  that the c symbol passed to the CHECK_FUNCTION_EXISTS macro can be
>  found by the linker, right ? I have a case where the symbol (namely
>  _snprintf) can be found, but the C declaration is not found in
>  cygwin-stdio.h (in which case I need to use snprintf declaration).
>
>   Is this correct ? If so is there a way to detect if a function can
>  be found in a particular header ?

I don't know but

The TRY_COMPILE statement inside CheckFunctionExists.cmake
should generate a warning about that?

May be (not tested)
turning warning to error will make CHECK_FUNCTION_EXISTS to fail?

For GCC this could be
SET(CMAKE_REQUIRED_FLAGS "-Werror")

but this is not portable :-(

-- 
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake and distutils

2008-04-22 Thread Alexander Neundorf
On Tuesday 22 April 2008, Christophe Alexandre wrote:
> Hi all,
>
> I'm working on a C++ project exporting its API with in Python.
> Is there an "easy..." way to compile and generate the Python Modules
> with cmake.
> I find the the distutils and cmake hard to use together : not the same
> build management, the installation process,...
> Wouldn't it be better to compile the Python Modules only with cmake ?
>
> If anyone has some experience on the subject, I'll be happy to hear
> from it.

Compiling python modules with cmake is no bigger problem.
You just have to build the target as "MODULE" library and link against the 
appropriate libs.
Do you need to do more ?

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Alexander Neundorf
On Tuesday 22 April 2008, Josef Karthauser wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> > Behalf Of dizzy
> > Sent: 22 April 2008 12:31
> > To: cmake@cmake.org
> > Subject: Re: [CMake] Differentiate between Linux and FreeBSD
> >
> > On Monday 21 April 2008 12:51:46 Horacio Sanson wrote:
> > > I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> > > cmake is executed in Windows or UNIX systems. The problem is that
> >
> > UNIX
> >
> > > in this context includes both Linux and FreeBSD.
> > >
> > > Has CMake a way to know if it is running in a Linux box or a FreeBSD
> >
> > box??
> >
> > Why do you need to know if it is a Linux or a FreeBSD?
>
> The generic way to tell is to call the 'uname' command, which
> generically tells you what operating system you are running on.  You can

Yes, and this is what cmake itself does to get CMAKE_SYSTEM_NAME (see 
Modules/CMakeDetermineSystem.cmake )

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] cmake and distutils

2008-04-22 Thread Christophe Alexandre

Hi all,

I'm working on a C++ project exporting its API with in Python.
Is there an "easy..." way to compile and generate the Python Modules  
with cmake.
I find the the distutils and cmake hard to use together : not the same  
build management, the installation process,...

Wouldn't it be better to compile the Python Modules only with cmake ?

If anyone has some experience on the subject, I'll be happy to hear  
from it.


Best Regards.

C. Alexandre
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindBoost.cmake updated on the bugtracker

2008-04-22 Thread Doug Gregor
On Sat, Apr 12, 2008 at 11:18 AM, Mike Jackson <[EMAIL PROTECTED]> wrote:
> Ok. I downloaded the latest CMake nightly (2.7-20080412) and gave this
>  FindBoost a shot with a MinGW current Stable release, which is I think
>  3.14, at least according to the _mingw.h file.
>
>  It didn't work. Here are the changes. Sorry, but I don't have a decent
>  diff generator on this windows box so you will have to merge stuff in:

Thanks!

All of these changes are in CMake CVS now.

  - Doug
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CHECK_FUNCTION_EXISTS question

2008-04-22 Thread Mathieu Malaterre
Hi there,

  If I understand correctly CHECK_FUNCTION_EXISTS is only checking
that the c symbol passed to the CHECK_FUNCTION_EXISTS macro can be
found by the linker, right ? I have a case where the symbol (namely
_snprintf) can be found, but the C declaration is not found in
cygwin-stdio.h (in which case I need to use snprintf declaration).

  Is this correct ? If so is there a way to detect if a function can
be found in a particular header ?

Thanks,
-- 
Mathieu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Horacio Sanson
I

On Tue, Apr 22, 2008 at 5:49 PM, Pau Garcia i Quiles
<[EMAIL PROTECTED]> wrote:
> Quoting Horacio Sanson <[EMAIL PROTECTED]>:
>
>
> > On Mon, Apr 21, 2008 at 7:01 PM, Pau Garcia i Quiles
> > <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > Quoting Horacio Sanson <[EMAIL PROTECTED]>:
> > >
> > >
> > > > I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> > > > cmake is executed in Windows or UNIX systems. The problem is that UNIX
> > > > in this context includes both Linux and FreeBSD.
> > > >
> > > > Has CMake a way to know if it is running in a Linux box or a FreeBSD
> box??
> > > >
> > >
> > >  Use the CMAKE_SYSTEM_NAME variable:
> > >
> >
> > I tried using this variable but for some reason it seems to be empty
> > (i.e. calling MESSAGE with this var as parameter does not print
> > anything). This happens in both Linux (Kubuntu 7.10) and FreeBSD 7.1.
> >
> >
>
>  It works for me:
>
>  MESSAGE( STATUS "Platform: " ${CMAKE_SYSTEM_NAME} )
>
>  outputs
>
>  -- Platform: Linux
>
>  What version of CMake are you using?
>
I have the version that comes default with Kubuntu Gutsy, (2.4.7-1).
Could you provide an example using the IF/ELSE functions??

thanks
Horacio
>  --
>
>  Pau Garcia i Quiles
>  http://www.elpauer.org
>  (Due to my workload, I may need 10 days to answer)
>
>
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Horacio Sanson
On Tue, Apr 22, 2008 at 8:31 PM, dizzy <[EMAIL PROTECTED]> wrote:
>
> On Monday 21 April 2008 12:51:46 Horacio Sanson wrote:
>  > I can use IF(WIN32) and IF(UNIX) to set some variables depending if
>  > cmake is executed in Windows or UNIX systems. The problem is that UNIX
>  > in this context includes both Linux and FreeBSD.
>  >
>  > Has CMake a way to know if it is running in a Linux box or a FreeBSD box??
>
>  Why do you need to know if it is a Linux or a FreeBSD?
>
>  Usually, it all boils down to checking specific conditions, libraries, paths
>  instead of checking a system and then setting those conditions, libraries,
>  paths to expeced values for that system. I find the former much better (and
>  more portable since it will probably work on systems that you have not
>  specifically addressed too).
>

I am new to CMake and the documentation is rather difficult to
digest  I have a small program that uses SCTP (Stream Control
Transmission Protocol) and it runs in both Linux and FreeBSD.

The problem is that in linux I have to add the sctp library (i.e.
-lsctp) if not compilation fails and in FreeBSD adding that library
would cause the compiler to complain.

if there is a better way to do this I am eager to learn it.


regards,
Horacio
>  --
>  Mihai RUSU  Email: [EMAIL PROTECTED]
> "Linux is obsolete" -- AST
>
>
> ___
>  CMake mailing list
>  CMake@cmake.org
>  http://www.cmake.org/mailman/listinfo/cmake
>
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] moc not being run successfully (every time) in Visual Studio 2003

2008-04-22 Thread John Drescher
I am running CMake-2.7.2008.04.21 and under Visual Studio moc does not
run correctly all the time for my QT4 projects.

Here is the  error:

-- Build started: Project: LungAnalysis, Configuration: Debug Win32 --

Generating qrc_LungAnalysis.cxx
Generating moc_textwidget.cxx
moc: Cannot open options file specified with @
Usage: moc [options] 
  -o   write output to file rather than stdout
  -Iadd dir to the include path for header files
  -E preprocess only; do not generate meta object code
  -D[=]  define macro, with optional definition
  -U  undefine macro
  -i do not generate an #include statement
  -p   path prefix for included file
  -f[] force #include, optional file name
  -nwdo not display warnings
  -v display version of moc
Project : error PRJ0019: A tool returned an error code from
"Generating moc_textwidget.cxx"

Build log was saved at
"file://x:\VC.NET\Libraries\MyCode\LungAnalysis\LungAnalysis.dir\Debug\BuildLog.htm"
LungAnalysis - 1 error(s), 0 warning(s)


-- Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 --

Project configuration skipped because it is not selected in this
solution configuration


-- Done --

Build: 0 succeeded, 1 failed, 1 skipped

If I run moc directly from the project directory all is fine:

[x:\vc.net\libraries\mycode\lunganalysis]moc @moc_textwidget.cxx_parameters

[x:\vc.net\libraries\mycode\lunganalysis]moc @moc_mainwindow.cxx_parameters

I ran through the Qt tutorial building everything (in my own folder)
using CMake to generate Visual Studio 2003 projects. For the 14
projects in the tutorial 3 or 4 of them failed with this error. Some
of the times exiting Visual C++ and restarting it caused it to work
correctly but others it failed the same way.

Here is an example CMakeLists.txt (Please note I just started using
CMake, QT and ITK last week ...)

PROJECT(LungAnalysis)

IF(WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 2.5 FATAL_ERROR)
ENDIF(WIN32)

SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all libraries.")
SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all executables.")

FIND_PACKAGE( Qt4 REQUIRED )
FIND_PACKAGE( ITK REQUIRED )

INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )

INCLUDE( ${QT_USE_FILE} ${ITK_USE_FILE} )

SET( UPMC_LA_SRCS
./main.cxx
./mainwindow.cxx
./textwidget.cxx
)

SET( UPMC_LA_MOC_HDR
./mainwindow.h
./textwidget.h
)

# and finally an resource file
SET( UPMC_LA_RCS
./rc/LungAnalysis.qrc
)

# this command will generate rules that will run rcc on all files from
UPMC_LA_RCS
# in result UPMC_LA_RC_SRCS variable will contain paths to files produced by rcc
QT4_ADD_RESOURCES( UPMC_LA_RC_SRCS ${UPMC_LA_RCS} )

# and finally this will run moc:
QT4_WRAP_CPP( UPMC_LA_MOC_SRCS ${UPMC_LA_MOC_HDR} )

LINK_LIBRARIES ( LungAnalysis ${QT_LIBRARIES} )

IF(COMMAND cmake_policy)
  cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

ADD_EXECUTABLE( LungAnalysis ${UPMC_LA_SRCS} ${UPMC_LA_MOC_SRCS}
${UPMC_LA_MOC_HDR} ${UPMC_LA_RC_SRCS} )


Thanks in Advance,
John
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Linker ignores LINK_DIRECTORIES

2008-04-22 Thread Gabor Fekete
Hi,

I use LINK_DIRECTORIES to specify the library directories for cmake. But during
compilation I see (with CMAKE_VERBOSE_MAKEFILE) that the linker (ld) is not
called with the paths that were specified in LINK_DIRECTORIES.
What can be the reason?

Here is my cmake list file:

PROJECT(rat-server)
SET(NAME testprog)
SET(VERSION 0.0.1)
SET(SRC_DIR ../src)
FILE(GLOB HeaderFiles "${SRC_DIR}/*.h")
FILE(GLOB SourceFiles "${SRC_DIR}/*.c")

#
# Below this line you MAY make modifications.
#
SET(CMAKE_VERBOSE_MAKEFILE ON)

ADD_EXECUTABLE(${NAME} ${SourceFiles})

SET(XTRA_PREFIX $ENV{XTRA_PREFIX})
IF (NOT XTRA_PREFIX)
SET(XTRA_PREFIX /usr/local)
ENDIF (NOT XTRA_PREFIX)

INCLUDE(FindPkgConfig)
pkg_check_modules(DBUS REQUIRED dbus-1)
pkg_check_modules(SQL REQUIRED sqlite3)
pkg_check_modules(SSL REQUIRED openssl)
INCLUDE_DIRECTORIES(${DBUS_INCLUDE_DIRS} ${SQL_INCLUDE_DIRS}
 ${SSL_INCLUDE_DIRS})
LINK_DIRECTORIES(${DBUS_LIBRARY_DIRS} ${SQL_LIBRARY_DIRS}
 ${SSL_LIBRARY_DIRS})
TARGET_LINK_LIBRARIES(${NAME}
pthread ipq
${DBUS_LIBRARIES} ${SQL_LIBRARIES} ${SSL_LIBRARIES} 
${RACOMMON_LIBRARIES})

ADD_DEFINITIONS("-Wall" "$ENV{XTRA_FLAGS}")

INSTALL(FILES ./${NAME} DESTINATION ${XTRA_PREFIX}/bin)

ADD_CUSTOM_TARGET(uninstall
COMMAND "rm" -rf "${XTRA_PREFIX}/bin/${NAME}"
)

When I run make after cmake, ld complains about libipq, but it is indeed present
in the LINK_DIRECTORIES. libipq.a is a static library, if it matters.
LINK_DIRECTORIES is used by gcc when compiling single c files, but not used
for linking.

Thanks,
Gabor
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to link executable with libraries containing circular dependencies

2008-04-22 Thread Martin Apel

Hi there,

I am trying to link an executable with multiple libraries, which 
reference each other in a circular fashion. It seems, that I cannot 
specify the same library multiple times
in TARGET_LINK_LIBRARIES, so the link line will always end up with each 
library listed exactly once. In my case, this leads to unresolved symbols.
I know that circular dependencies are not nice, but it's a large 
"inherited" project I would like to convert to use CMake.
I posted this issue before, trying to resolve it using the --start-group 
and --end-group options to the linker, but haven't gotten any responses yet.
To me it looks, as if CMake is not able to handle linker calls with 
circular references. Any pointers?


Regards,

Martin

--
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Josef Karthauser
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of dizzy
> Sent: 22 April 2008 12:31
> To: cmake@cmake.org
> Subject: Re: [CMake] Differentiate between Linux and FreeBSD
> 
> On Monday 21 April 2008 12:51:46 Horacio Sanson wrote:
> > I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> > cmake is executed in Windows or UNIX systems. The problem is that
> UNIX
> > in this context includes both Linux and FreeBSD.
> >
> > Has CMake a way to know if it is running in a Linux box or a FreeBSD
> box??
> 
> Why do you need to know if it is a Linux or a FreeBSD?
>

The generic way to tell is to call the 'uname' command, which
generically tells you what operating system you are running on.  You can
contrive to call this from within CMake if you care to.

Joe

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread dizzy
On Monday 21 April 2008 12:51:46 Horacio Sanson wrote:
> I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> cmake is executed in Windows or UNIX systems. The problem is that UNIX
> in this context includes both Linux and FreeBSD.
>
> Has CMake a way to know if it is running in a Linux box or a FreeBSD box??

Why do you need to know if it is a Linux or a FreeBSD? 

Usually, it all boils down to checking specific conditions, libraries, paths 
instead of checking a system and then setting those conditions, libraries, 
paths to expeced values for that system. I find the former much better (and 
more portable since it will probably work on systems that you have not 
specifically addressed too).

-- 
Mihai RUSU  Email: [EMAIL PROTECTED]
"Linux is obsolete" -- AST
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Differentiate between Linux and FreeBSD

2008-04-22 Thread Pau Garcia i Quiles

Quoting Horacio Sanson <[EMAIL PROTECTED]>:


On Mon, Apr 21, 2008 at 7:01 PM, Pau Garcia i Quiles
<[EMAIL PROTECTED]> wrote:


Quoting Horacio Sanson <[EMAIL PROTECTED]>:


> I can use IF(WIN32) and IF(UNIX) to set some variables depending if
> cmake is executed in Windows or UNIX systems. The problem is that UNIX
> in this context includes both Linux and FreeBSD.
>
> Has CMake a way to know if it is running in a Linux box or a FreeBSD box??
>

 Use the CMAKE_SYSTEM_NAME variable:


I tried using this variable but for some reason it seems to be empty
(i.e. calling MESSAGE with this var as parameter does not print
anything). This happens in both Linux (Kubuntu 7.10) and FreeBSD 7.1.



It works for me:

MESSAGE( STATUS "Platform: " ${CMAKE_SYSTEM_NAME} )

outputs

-- Platform: Linux

What version of CMake are you using?

--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake