Re: [CMake] Question about overriding Find modules in cmake

2009-03-31 Thread Andreas Pakulat
On 30.03.09 17:10:10, Allen Gooch wrote: When I run it, the messages indicate that my FindExpat is being used, instead of the one installed by cmake in /usr/local/share/cmake-2.7/Modules/FindEXPAT.cmake, however my logging out of the Expat_INCLUDE_DIR and Expat_LIBRARY values indicate that

[CMake] FindBoost problem when cross-compiling

2009-03-31 Thread ross hennessy
In your toolchain file, what do you have CMAKE_FIND_ROOT_PATH_MODE_INCLUDE set to? If it is set to ONLY, then cmake will only look in the CMAKE_FIND_ROOT_PATH for boost, which is probably set to $QNX_TARGET. Since you most likely don't have boost in your $QNX_TARGET directory, findBoost will

Re: [CMake] Bug in if/else/endif in combination with option?

2009-03-31 Thread Marcel Loose
Hi James, Thanks for your reply. I'm going to comment on your remarks inline. But first, let me explain what I wanted to accomplish. My intention is to keep a list of valid CMake options so that I can iterate over it. It would have been nice if CMake offered another way of doing this, but I

Re: [CMake] autoheader

2009-03-31 Thread Marcel Loose
Hi Bill, Wouldn't it be better if CMake kept track of these variables internally. I mean, usually the HAS_X variables are the result of calls to check_include_file() and check_function_exists(). The Autotools handle this under the hood. CMake might keep a list of these variables, possibly one per

[CMake] Bug in library link order?

2009-03-31 Thread Denis Scherbakov
Dear CMake Community, I have a project where there are: LibraryA LibraryB (depends on LibraryA) Executable (depends on LibraryB and xml2) during linking the order for link libraries is LibraryB -lxml2 LibraryA. Should LibraryA (which is internal to the project) be specified before external

Re: [CMake] Bug in library link order?

2009-03-31 Thread Marcel Loose
Hi Denis, That doesn't really matter. What *does* matter is that libraries appear in dependency order. I mean by that: if libA depends on libB, then libB must appear after libA on the link line. But if libA does not depend on, say libxml, than the order of these two libs is irrelevant. Best

[CMake] Weird STREQUAL behaviour

2009-03-31 Thread Marcel Loose
Hi all, Could anyone shed a light on the following. IMHO it's a bug. I'm running cmake version 2.6-patch 2. Here's my initial CMakeLists.txt file: cmake_minimum_required(VERSION 2.6) set(options fine good bad) option(fine Fine OFF) option(good Good OFF) option(bad Bad OFF) foreach(opt

Re: [CMake] How to surround an imported lib with extra flags on link?

2009-03-31 Thread Alexandre Feblot
Hi again, Would anybody have a solution for this? Thanks Alexandre Sent: Monday, 30 March 2009 17:31 Hi, I import some libs like this: add_library(${name} ${type} IMPORTED) set_target_properties(${name} PROPERTIES

Re: [CMake] Cross-compilation linking against host libc

2009-03-31 Thread Adolfo Rodríguez
2009/3/30 Alexander Neundorf a.neundorf-w...@gmx.net On Monday 30 March 2009, Adolfo Rodríguez wrote: Hi, I have set up a toolchain file [1] to enable cross-compiling a project. In my current setup, both the host and target environments are binary-compatible (both are x86 and are

Re: [CMake] autoheader

2009-03-31 Thread Bill Hoffman
Marcel Loose wrote: Hi Bill, Wouldn't it be better if CMake kept track of these variables internally. I mean, usually the HAS_X variables are the result of calls to check_include_file() and check_function_exists(). The Autotools handle this under the hood. CMake might keep a list of these

Re: [CMake] How to surround an imported lib with extra flags onlink?

2009-03-31 Thread Martin Apel
Hi Alexandre, I don't think that CMake is able to handle this. I searched for a solution to a similar problem involving the use of the --start-group and --end-group option for ld on Linux. You might be able to define custom rules for this, but then you are definitely on platform-dependent ground.

Re: [CMake] How to surround an imported lib with extra flags onlink?

2009-03-31 Thread Alexandre Feblot
Hi Martin, Well, I came to this ugly platform-dependant workaround. I hate that, but it works. Example: Here, libC depends on libB which depends on libA. To surround libB: IMPORTED_LINK_INTERFACE_LIBRARIES for libB: -z defaultextract;libA IMPORTED_LINK_INTERFACE_LIBRARIES for libC: -z

Re: [CMake] autoheader

2009-03-31 Thread BRM
I think the better solution would be to have the various Find functions (package, library, program) define a variable for that package to an internal list - which is what I think Marcel might have been hinting at. The user could add more variables to the same internal list. So essentially: #

[CMake] CPack with NSIS

2009-03-31 Thread Robert Bielik
I'm trying to use CPack to install a target at: C:\Program Files\Vendor\Package but it seems that CPack only allows me to do: C:\Program Files\Package Any ideas how to create that extra directory hierarchy? TIA /Rob ___ Powered by

Re: [CMake] CPack with NSIS

2009-03-31 Thread David Cole
According to CMake/Modules/NSIS.template.in : ;Default installation folder InstallDir $programfil...@cpack_package_install_directory@ So set the variable CPACK_PACKAGE_INSTALL_DIRECTORY to be Vendor\Package like this: SET(CPACK_PACKAGE_INSTALL_DIRECTORY Vendor\\Package) Then set the

[CMake] Compile all .c source files with the CXX compiler

2009-03-31 Thread Alexandre Feblot
Hi, In my project, all sources named .c are C++ files, and should be considered as CXX language files. I tried to set this with CMAKE_LANG_SOURCE_FILE_EXTENSIONS, at the very beginning of my project, without success. How should I do it? cmake_minimum_required (VERSION 2.6)

Re: [CMake] Compile all .c source files with the CXX compiler

2009-03-31 Thread Pau Garcia i Quiles
Hello, Try SET_SOURCE_FILES_PROPERTIES( file1.c file2.c file3.c PROPERTIES LANGUAGE CXX ) On Tue, Mar 31, 2009 at 5:16 PM, Alexandre Feblot alexandre.feb...@thomsonreuters.com wrote: Hi, In my project, all sources named .c are C++ files, and should be considered as CXX language files.

Re: [CMake] autoheader

2009-03-31 Thread James Bigler
On Tue, Mar 31, 2009 at 7:04 AM, BRM bm_witn...@yahoo.com wrote: I think the better solution would be to have the various Find functions (package, library, program) define a variable for that package to an internal list - which is what I think Marcel might have been hinting at. The user

[CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C . Sutherland
I am trying to compile a mixed f90/C++ program linked with g++. The fortran compiler flags don't seem to be automatically passed through to the g++ linker. For example, I want to do: set( CMAKE_Fortran_FLAGS -fconvert=big-endian ) When I do this for a fortran program (linked with

Re: [CMake] autoheader

2009-03-31 Thread Bill Hoffman
James Bigler wrote: If this feature comes to fruition, I would like the ability to specify which flags make it into what header. In one project I worked on all our configuration defines were in a single header. This caused extremely long recompiles if something happened to change the one

Re: [CMake] Compile all .c source files with the CXX compiler

2009-03-31 Thread Alexandre Feblot
Well, I indeed found this to work, but my project has about 2 c files. Alin, forcing CC to a C++ compiler is not an option either, as I also have a couple of libs which must be compiled with a C-ansi compiler. I found that I could get the correct behaviour by modifying the value of

[CMake] Make target dependent on all executables libraries

2009-03-31 Thread Lezz Giles
I want to use doxygen to generate documentation, but I also want it to only run if something has changed. At first I was playing with the idea of having it be dependent on all source header files, but I quickly realized that that would be difficult or impossible in cmake. Then I realized

Re: [CMake] Compile all .c source files with the CXX compiler

2009-03-31 Thread Pau Garcia i Quiles
Hello, Have you tried PROJECT( myproject CXX ) ? On Tue, Mar 31, 2009 at 5:53 PM, Alexandre Feblot alexandre.feb...@thomsonreuters.com wrote: Well, I indeed found this to work, but my project has about 2 c files. Alin, forcing CC to a C++ compiler is not an option either, as I also have a

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
Hi, Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? regards, Alin -- __ If the Universities will not study useless subjects, who will?

Re: [CMake] Compile all .c source files with the CXX compiler

2009-03-31 Thread Mathieu Malaterre
On Tue, Mar 31, 2009 at 5:53 PM, Alexandre Feblot alexandre.feb...@thomsonreuters.com wrote: Well, I indeed found this to work, but my project has about 2 c files. Nice ! It this project called GNU/Linux ? ;) Alin, forcing CC to a C++ compiler is not an option either, as I also have a

Re: [CMake] autoheader

2009-03-31 Thread BRM
How about: # Each variable can have a registered filter name - packages/programs/libraries would use their name cmake_autoheader_add_variable(has_some_other_package, filter_name) # user controls what the output file is # User can generate a C #define method (default method if no language

Re: [CMake] Make target dependent on all executables libraries

2009-03-31 Thread Adolfo Rodríguez
How about making it depend on the ALL target? On Tue, Mar 31, 2009 at 6:07 PM, Lezz Giles lgi...@soapstonenetworks.comwrote: I want to use doxygen to generate documentation, but I also want it to only run if something has changed. At first I was playing with the idea of having it be

Re: [CMake] Bug in if/else/endif in combination with option?

2009-03-31 Thread James Bigler
CMake if commands are interesting in the sense that variable names can be used directly. In most other languages you have to explicitly dereference the variable to get the value out. I think when you use a string that is the same name as a variable you are getting problems. if(variable

Re: [CMake] autoheader

2009-03-31 Thread Bill Hoffman
BRM wrote: How about: # Each variable can have a registered filter name - packages/programs/libraries would use their name cmake_autoheader_add_variable(has_some_other_package, filter_name) # user controls what the output file is # User can generate a C #define method (default method if

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? I tried adding add_definitions( ${CMAKE_Fortran_FLAGS} ) But the g++ linker complained about an unrecognized option (the - fconvert=big-endian option). When

Re: [CMake] Make target dependent on all executables libraries

2009-03-31 Thread Tyler Roscoe
On Tue, Mar 31, 2009 at 06:18:49PM +0200, Adolfo Rodríguez wrote: How about making it depend on the ALL target? I believe this will cause the doxygen target to be run every time, which is not what the OP wants. My first guess would be the ALL_TARGETS approach. Just make it part of your coding

Re: [CMake] autoheader

2009-03-31 Thread James Bigler
On Tue, Mar 31, 2009 at 9:45 AM, Bill Hoffman bill.hoff...@kitware.comwrote: James Bigler wrote: If this feature comes to fruition, I would like the ability to specify which flags make it into what header. In one project I worked on all our configuration defines were in a single header.

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
Hi, g++ knows of -mbig-endian not -f Anyhow is just a thought. Alin -- __ If the Universities will not study useless subjects, who will? G. F. FitzGerald, Nature, 45/46, 392 (1892)

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Denis Scherbakov
If you want to pass something to g++ linker, you should do this with -Wl,--my-special-flag Denis Should not the flag be passed to the linker? So in this case the linker flags are read from the c++ compiler flags? I tried adding add_definitions( ${CMAKE_Fortran_FLAGS} ) But

Re: [CMake] Make target dependent on all executables libraries

2009-03-31 Thread Lezz Giles
I don't think I can make a custom command depend on ALL. Here's the relevant CMakeLists.txt fragment that I have now... ADD_EXECUTABLE( hellow hellow.c ) ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/docs COMMAND cat ${CMAKE_SOURCE_DIR}/hellowdoc.template ${CMAKE_BINARY_DIR}/docs)

[CMake] Transitive linking and imported targets

2009-03-31 Thread Tobias Rudolph
Hi All, I am trying to build a project containing several subprojects that are included via add_subdirectory. Now, here is an example demonstrating the problem: The test project contains the following CMakeLists.txt: project( CMakeTest ) cmake_minimum_required( VERSION 2.6 )

Re: [CMake] autoheader

2009-03-31 Thread BRM
Yes, my solution does have a more global variable list. However, I think that in this case it works to your advantage as you only have to build the list once and no one has to explicitly know about each list. This makes using a find function (e.g. FindQt()) easier to write - it just has append

Re: [CMake] CPack with NSIS

2009-03-31 Thread Robert Bielik
David Cole skrev: (The CPACK_NSIS_DISPLAY_NAME variable defaults to the same as CPACK_PACKAGE_INSTALL_DIRECTORY, but you probably don't want the Vendor\\ in the display name, which is used elsewhere in NSIS.template.in http://NSIS.template.in.) Thanx, but it doesn't work as expected,

Re: [CMake] autoheader

2009-03-31 Thread Clinton Stimpson
How would this global auto header stuff work with two sub projects both wanting to do auto headers? Do they share one header, or do they get their own? If they share, what if they both want a different name for the header file? Clint BRM wrote: Yes, my solution does have a more global

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
g++ knows of -mbig-endian not -f g++ --help -v provides no information on any endian operations.___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Let me try this again. I have a f90 subroutine that performs file IO. I would like to link that with a C++ driver. If I use a fortran driver, I am able to set the binary format via set( CMAKE_Fortran_FLAGS -fconvert=big-endian ) This results in file IO in big-endian format. When

[CMake] Xcode generator?

2009-03-31 Thread Robert Dailey
What is the xcode generator name on the command line? I don't see it in the official list of generatorshttp://cmake.org/cmake/help/cmake2.6docs.html#section_Generators . ___ Powered by www.kitware.com Visit other Kitware open-source projects at

Re: [CMake] Xcode generator?

2009-03-31 Thread David Cole
It's name is Xcode and it's only available on the Mac build of CMake. On Tue, Mar 31, 2009 at 2:33 PM, Robert Dailey rcdai...@gmail.com wrote: What is the xcode generator name on the command line? I don't see it in the official list of

Re: [CMake] Xcode generator?

2009-03-31 Thread David Cole
(And the official list you pointed to is generated by a Windows build of CMake) On Tue, Mar 31, 2009 at 2:34 PM, David Cole david.c...@kitware.com wrote: It's name is Xcode and it's only available on the Mac build of CMake. On Tue, Mar 31, 2009 at 2:33 PM, Robert Dailey rcdai...@gmail.com

Re: [CMake] Transitive linking and imported targets

2009-03-31 Thread Hendrik Sattler
Am Dienstag 31 März 2009 19:48:49 schrieb Tobias Rudolph: add_library( iLib SHARED IMPORTED ) set_target_properties( iLib PROPERTIES IMPORTED_LOCATION /opt/local/ lib/libzip.dylib ) add_library( libFoo SHARED foo.cpp ) target_link_libraries( libFoo iLib ) According to the

Re: [CMake] Xcode generator?

2009-03-31 Thread Robert Dailey
Thanks David. Where can I find a platform-ambiguous version of the documentation then? On Tue, Mar 31, 2009 at 1:35 PM, David Cole david.c...@kitware.com wrote: (And the official list you pointed to is generated by a Windows build of CMake) On Tue, Mar 31, 2009 at 2:34 PM, David Cole

Re: [CMake] autoheader

2009-03-31 Thread BRM
Notice my original API suggestion - the project controls its own header - just not the list of available items. So essentially: 1) Cmake runs, finds packages, builds list 2) user add extra items to list 3) header generated Noting from my original API example: cmake_autoheader(C,

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread Alin M Elena
man g++ add_definition is a preprocessor directive not linking flag Alin -- __ If the Universities will not study useless subjects, who will? G. F. FitzGerald, Nature, 45/46, 392 (1892)

Re: [CMake] Xcode generator?

2009-03-31 Thread Bill Hoffman
Robert Dailey wrote: Thanks David. Where can I find a platform-ambiguous version of the documentation then? There really is not any for this... cmake --help Will give you the generators available for your particular cmake. -Bill ___ Powered by

Re: [CMake] autoheader

2009-03-31 Thread Alexander Neundorf
On Tuesday 31 March 2009, BRM wrote: I think the better solution would be to have the various Find functions (package, library, program) define a variable for that package to an internal list - which is what I think Marcel might have been hinting at. Something similar exists for FIND_PACKAGE()

Re: [CMake] autoheader

2009-03-31 Thread Alexander Neundorf
On Tuesday 31 March 2009, Bill Hoffman wrote: Marcel Loose wrote: Hi Bill, Wouldn't it be better if CMake kept track of these variables internally. I mean, usually the HAS_X variables are the result of calls to check_include_file() and check_function_exists(). The Autotools handle

Re: [CMake] autoheader

2009-03-31 Thread Alexander Neundorf
On Tuesday 31 March 2009, James Bigler wrote: ... Why not something similar to what you proposed, but without the intermediate configure.h.in step and being able to specify comments and perhaps custom strings. You could also specify things multiple kinds and they all just get inserted one

Re: [CMake] Cross-compilation linking against host libc

2009-03-31 Thread Alexander Neundorf
On Tuesday 31 March 2009, Adolfo Rodríguez wrote: 2009/3/30 Alexander Neundorf a.neundorf-w...@gmx.net ... [1] In case you think it helps, these are my rpath settings: # Use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) # When building, don't use the

[CMake] Question regarding list arguments in macros

2009-03-31 Thread Allen Gooch
I have the following macro for generation of c++ source from a proprietary IDL language: macro (oidl_generate IDL_SOURCES IDL_INCLUDE_DIRS) message (STATUS IDL Sources: ${IDL_SOURCES}) foreach (idlsrc ${IDL_SOURCES}) get_filename_component (idlsrc_file ${idlsrc} NAME_WE)

Re: [CMake] Make target dependent on all executables libraries

2009-03-31 Thread Tyler Roscoe
On Tue, Mar 31, 2009 at 12:47:33PM -0400, Lezz Giles wrote: ADD_EXECUTABLE( hellow hellow.c ) ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/docs COMMAND cat ${CMAKE_SOURCE_DIR}/hellowdoc.template ${CMAKE_BINARY_DIR}/docs) ADD_CUSTOM_TARGET(documentation DEPENDS ${CMAKE_BINARY_DIR}/docs)

[CMake] CMake SWIG support for nested python modules

2009-03-31 Thread Bill Spotz
Hello, I am the developer of PyTrilinos, the python interface to Trilinos and I have hit upon some unexpected behavior. I am trying to wrap the interface to NOX, which utilizes nested namespaces. I shadow this structure in python by utilizing nested modules. For example, a subset of

[CMake] How to pass values up to parent CMakeLists.txt

2009-03-31 Thread Lezz Giles
So I want to collect a list of targets which I'll use in a central CMakeLists.txt. My files are arranged like this: Project CMakeLists.txt -Central CMakeLists.txt file which pulls in o src/CMakeLists.txt o tst/CMakeLists.txt -Central CMakeLists.txt file then defines a

Re: [CMake] Transitive linking and imported targets

2009-03-31 Thread Tobias Rudolph
On Mar 31, 2009, at 21:10, Hendrik Sattler wrote: Am Dienstag 31 März 2009 19:48:49 schrieb Tobias Rudolph: add_library( iLib SHARED IMPORTED ) set_target_properties( iLib PROPERTIES IMPORTED_LOCATION /opt/local/ lib/libzip.dylib ) add_library( libFoo SHARED foo.cpp )

Re: [CMake] Question regarding list arguments in macros

2009-03-31 Thread James Bigler
On Tue, Mar 31, 2009 at 2:06 PM, Allen Gooch allen.go...@gmail.com wrote: I have the following macro for generation of c++ source from a proprietary IDL language: macro (oidl_generate IDL_SOURCES IDL_INCLUDE_DIRS) message (STATUS IDL Sources: ${IDL_SOURCES}) foreach (idlsrc

Re: [CMake] How to pass values up to parent CMakeLists.txt

2009-03-31 Thread James Bigler
On Tue, Mar 31, 2009 at 2:50 PM, Tyler Roscoe ty...@cryptio.net wrote: On Tue, Mar 31, 2009 at 04:47:23PM -0400, Lezz Giles wrote: What I want to do is pass values up from src/CMakeLists.txt and tst/CMakeLists.txt that can be used in the custom_command. A normal variable doesn't work - the

Re: [CMake] fortran flags in a c++ linked executable

2009-03-31 Thread James C. Sutherland
Alin, Thank you for your patience. I now have this set via set( CMAKE_EXE_LINKER_FLAGS -mbig-endian ) However, this does not seem to affect the reading of the big-endian binary file (which is in read in fortran). Perhaps I am still not setting it properly? James On Mar 31,

[CMake] 2.6.4 RC 3

2009-03-31 Thread Bill Hoffman
Mostly to fix the issue with Visual Studio and header files that was introduced with CMake 2.6.3, I am working on 2.6.4. I have a release candidate RC 3 that can be found here: http://www.cmake.org/files/v2.6 Other changes in 2.6.4 are as follows: Changes in CMake 2.6.4 RC 3 - Documentation

Re: [CMake] How to pass values up to parent CMakeLists.txt

2009-03-31 Thread Philip Lowman
On Tue, Mar 31, 2009 at 6:13 PM, James Bigler jamesbig...@gmail.com wrote: I just recently discovered another way to do this. I was troubled that pushing it up to the parent scope only pushes it up one level, so if you want to push a variable up to the top, you must push it at each level in

Re: [CMake] How to pass values up to parent CMakeLists.txt

2009-03-31 Thread James Bigler
On Mar 31, 2009, at 8:46 PM, Philip Lowman phi...@yhbt.com wrote: On Tue, Mar 31, 2009 at 6:13 PM, James Bigler jamesbig...@gmail.com wrote: I just recently discovered another way to do this. I was troubled that pushing it up to the parent scope only pushes it up one level, so if you want

Re: [CMake] autoheader

2009-03-31 Thread Philip Lowman
On Tue, Mar 31, 2009 at 3:27 PM, BRM bm_witn...@yahoo.com wrote: Notice my original API suggestion - the project controls its own header - just not the list of available items. So essentially: 1) Cmake runs, finds packages, builds list 2) user add extra items to list 3) header generated

Re: [CMake] how-to get cmake command line after running ccmake

2009-03-31 Thread Philip Lowman
On Tue, Mar 31, 2009 at 12:23 AM, James Bigler jamesbig...@gmail.comwrote: I think he wants to run ccmake and configure things how he likes and then get a command line that would produce the equivalent configuration without ccmake (i.e. cmake -DSOMEVAR:BOOL=ON

Re: [CMake] CPack with NSIS

2009-03-31 Thread Robert Bielik
By changing NSIS.template.in to use CPACK_NSIS_DISPLAY_NAME instead as Name for the installation, it works fine. Actually I see now that this is bug (http://public.kitware.com/Bug/view.php?id=8682) /R ___ Powered by www.kitware.com Visit other