[CMake] parsing config.h files and setting cmake variables accordingly
Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET ${CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET ${CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] parsing config.h files and setting cmake variables accordingly
Hello, Take a look at CONFIGURE_FILE On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET ${CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET ${CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] parsing config.h files and setting cmake variables accordingly
Hi, thanks for the hint, but my problem is exactly the opposite of the one configure_file is solving. I'm already using configure_file in multiple places, but here I don't want to write config files, instead I want to parse their content back to cmake, and that's why I don't think configure_file. Regards Clemens Pau Garcia i Quiles wrote: Hello, Take a look at CONFIGURE_FILE On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET ${CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET ${CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] parsing config.h files and setting cmake variables accordingly
Hello, I see. So, where is that config.h created? In your CMake build-system? is it from an external library? If the former, maybe you could use variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't know (the only thing I can come with at this moment to survive additional spaces, etc are regular expressions). On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, thanks for the hint, but my problem is exactly the opposite of the one configure_file is solving. I'm already using configure_file in multiple places, but here I don't want to write config files, instead I want to parse their content back to cmake, and that's why I don't think configure_file. Regards Clemens Pau Garcia i Quiles wrote: Hello, Take a look at CONFIGURE_FILE On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET ${CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET ${CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] parsing config.h files and setting cmake variables accordingly
Hello, the config files were written some years ago simply to collect all the possibilities how to compile the projects. Unfortunately this was long before cmake came into play, thus the problem just came up now because I wanted to set up a system for nightly builds. Well, I think the best solution might be to drop the old config.h file and to replace it by a file for setting the variables in the cmake environment, and finally to create a new config.h version with cmake online with a call to configure_file. I think, this is, in principal, the way you might have kept in mind when you suggested a look at configure_file, right? Regards Clemens Pau Garcia i Quiles wrote: Hello, I see. So, where is that config.h created? In your CMake build-system? is it from an external library? If the former, maybe you could use variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't know (the only thing I can come with at this moment to survive additional spaces, etc are regular expressions). On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, thanks for the hint, but my problem is exactly the opposite of the one configure_file is solving. I'm already using configure_file in multiple places, but here I don't want to write config files, instead I want to parse their content back to cmake, and that's why I don't think configure_file. Regards Clemens Pau Garcia i Quiles wrote: Hello, Take a look at CONFIGURE_FILE On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET ${CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET ${CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] parsing config.h files and setting cmake variables accordingly
That is the best way to do it. Have all the options in your CMake file and let the user select which options they want to compile with. Then configure_file to create your config.h file. --- Mike Jackson www.bluequartz.net On Feb 13, 2009, at 7:45 AM, Clemens Arth wrote: Hello, the config files were written some years ago simply to collect all the possibilities how to compile the projects. Unfortunately this was long before cmake came into play, thus the problem just came up now because I wanted to set up a system for nightly builds. Well, I think the best solution might be to drop the old config.h file and to replace it by a file for setting the variables in the cmake environment, and finally to create a new config.h version with cmake online with a call to configure_file. I think, this is, in principal, the way you might have kept in mind when you suggested a look at configure_file, right? Regards Clemens Pau Garcia i Quiles wrote: Hello, I see. So, where is that config.h created? In your CMake build- system? is it from an external library? If the former, maybe you could use variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't know (the only thing I can come with at this moment to survive additional spaces, etc are regular expressions). On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, thanks for the hint, but my problem is exactly the opposite of the one configure_file is solving. I'm already using configure_file in multiple places, but here I don't want to write config files, instead I want to parse their content back to cmake, and that's why I don't think configure_file. Regards Clemens Pau Garcia i Quiles wrote: Hello, Take a look at CONFIGURE_FILE On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at wrote: Hi, I've got a question concerning string processing in cmake. Our software framework consists of multiple libraries and has many different features to be enabled or disabled using #defines. For example, one option is to compile with OpenGL or with OpenGL ES support. Thus in a config.h file, one of two variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. Depending on the variable defined cmake should link against a specific set of libraries. Currently determining which feature is set works the following way in my CMakeLists.txt: Code: # check for the configuration and set the corresponding GL/GLES libraries accordingly FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG) STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET $ {CURRENT_CONFIG}) STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET $ {CURRENT_CONFIG}) IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) MESSAGE(GLES config!) ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) IF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(GL config!) ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET}) MESSAGE(Error! USE_GL or USE_GLES must be defined!) ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET}) ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET}) Note that this is really a bad hack. First, if GLES_IS_SET is set ,GL_IS_SET is also set automatically. Second, if by accident the string does not exactly match the content (an additional space, or there is a second variable, for example called USE_OPENGL_EXTRAS), everything gets really weird or fails at all. Finally, a problem is that cmake does not actually notice if I changed the config.h file, so there should be an option to mark the configuration as dirty if the config.h file is altered - this is a problem which must not necessarily be solved, but maybe there is a simple solution to this. Can someone give me some tips how to improve my really ugly solution? Thanks and best regards Clemens ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] LINK_FLAGS does not seem to work
Hi, I'm trying to use LINK_FLAGS to pass some extra user defined arguments for linking WrapITK modules. However, effectively, the flags are never passed. Using LINK_FLAGS_RELEASE etc does not help this as well. Is this a cmake problem or am I supposed to use LINK_FLAGS explicitly in my linker? -Ali ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can FindBoost.cmake support STLport
Patch attached and also added to the bug report. Actually since it was part of the ABI tag it was fairly simple to fix. Now wee need some volunteers to test the patch/fix. FindBoost.cmake.diff Description: Binary data _ Mike Jackson mike.jack...@bluequartz.net BlueQuartz Softwarewww.bluequartz.net Principal Software Engineer Dayton, Ohio On Feb 12, 2009, at 11:53 PM, Philip Lowman wrote: On Wed, Feb 11, 2009 at 8:34 PM, unixcc uni...@gmail.com wrote: Today, I compiled two Boost libraries with following command: bjam --with-thread --with-date_time stdlib=stlport --build- type=complete stage So, I got following libraries boost_date_time-vc80-mt-gdp-1_38.dll ... libboost_thread-vc80-mt-sp.lib Thanks for attaching the libraries. I've opened a bug for this issue because unfortunately fixing it will be non-trivial and necessitate cleaning up the mess below without introducing any regressions. I think this is something that can be fixed post 2.6.3. Please create a bug tracker account and Monitor the following issue as testing would obviously be appreciated once a patch is made available. http://public.kitware.com/Bug/view.php?id=8529 Also we should be able to add options for nonstandard IOstreams and python debug at the same time. FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-$ {Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}${_boost_STATIC_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT} HINTS ${_boost_LIBRARIES_SEARCH_DIRS} ) FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-$ {Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}$ {_boost_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-$ {Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}-${_boost_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}$ {_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} HINTS ${_boost_LIBRARIES_SEARCH_DIRS} ) -- Philip Lowman ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] MSVC7.1 static link question
Philip Lowman ha scritto: On Thu, Feb 12, 2009 at 11:43 AM, Luigi Calori l.cal...@cineca.it mailto:l.cal...@cineca.it wrote: Philip Lowman ha scritto: add_library(baz STATIC IMPORTED) set_target_properties(baz PROPERTIES IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbaz.a IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/libbazd.a) add_library(bar STATIC IMPORTED) set_target_properties(bar PROPERTIES IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbar.a IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/libbard.a IMPORTED_LINK_INTERFACE_LIBRARIES baz) # -- dependency is here I' ma bit confused, just to make clear: the proposed import method are used in the final projects that USES the libraries. by install(EXPORT) the needed code is hidden in a config--baz--cmake file that is evaluated inby the final project tha so does not have to rely on FindBAZ script. But effectively this is just a way to hide the fact that the final project links to both libbaz and libbar The specification of dependency lib as a STATIC_LIBRARY_FLAGS produce a bigger library tha has both baz and bar, and can be used straight, at least under VS7.1 I appreciate the IMPORT and EXPORT stuff and will try to use that (could we use that also for the whole OpenSceneGraph itself ? what do you think Philip?) Nevertheless the STATIC_LIBRARY_FLAGS seems much simpler Not to take things too off-topic, but I actually like the idea of building libjpeg, libtiff, libpng, and even libfreetype within the OSG itself just like VTK does, but building them only on Windows platforms (especially since Kitware has already CMakeified them). If Robert has concerns about tarball size these could always be located in a separate tarball for releases that Windows users would have to download separately. For Linux, though, I think it would be a mistake to build these libraries since 99% of distributions have them anyways and they are well maintained with bugfixes and security patches. As I work on vs7.1 I had to cmakify tha basic libs and build from sources. I currently have a cmake project for building statically: tiff-3.7.4 zlib-1.2.3 libpng-1.2.24 jpeg-6b freetype-2.3.5 curl-7.18.1 Looking at CVS vtk site seems that theyr tiff is more recent (3.8.2) regarding the other, is quite difficult to see the versions. I' ve tried to keep the lib themself separated from the CMake, so I get the zip, uncompress in a separate folder and then build. I also think it would be be better to provide a separate project for deps, probably using EXPORT/IMPORT stuff I do not know if VTK utils can be built alone without building VTK. It would be really nice to have a standard way to package source through CMake, like a cross platform portage. This would get you what you want on WIN32 anyways which is being able to use the libraries statically while at the same time it would reduce the burden on maintaining the 3rdPartyDeps solution for OSG for every possible way of compiling with Visual Studio 7.1, 8.0, or 9.0 (and by the way, would you like /MT or /MD with that?). In regards to your question though, IMPORT/EXPORT looks very interesting for CMake projects, but I really haven't used it in this context yet or for importing external dependencies (other than bar and baz) to have an opinion on the matter. :) I think Bill has some good points about portability. I didn't completely understand what you needed STATIC_LIBRARY_FLAGS for. In fact part of me still doesn't as I've never needed to clump static libraries together for convenience in any of the projects I work on. The question I've posed comes from the fact that I would like to compile myself the dependencies in a way that mimick OSG Mike prebuilt libs. As I do have to pack everyting in a firefox plugin I prefer static linking. The problem is that without using STATIC_LIBRARY_FLAGS hack I obtain a tiff lib that need jpeg and zlib specified on the link line, and so the linkage is not consistent to everyone else. Regards Luigi ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can FindBoost.cmake support STLport
On Fri, Feb 13, 2009 at 8:46 AM, Michael Jackson mike.jack...@bluequartz.net wrote: Patch attached and also added to the bug report. Actually since it was part of the ABI tag it was fairly simple to fix. Now wee need some volunteers to test the patch/fix. I considered the same patch. Because _boost_ABI_TAG is not used during RELEASE you would miss this case below: boost_thread-vc80-mt-p-1_38.lib boost_thread-vc80-mt-p.lib One approach would be to make _boost_ABI_TAG be what it should be, the ABI tags, and get rid of _boost_STATIC_TAG. I haven't done much work here but I was thinking building up two versions of the ABI_TAG, one for RELEASE and one for DEBUG incrementally in the order the options are defined by Boost... set( _boost_ABI_TAG -) set( _boost_ABI_TAG_DEBUG -) # Build the ABI tag in the following order # s = linking statically to the C++ standard library and compiler #runtime support libraries (MSVC) if(WIN32 AND Boost_USE_STATIC_LIBS ) set( _boost_ABI_TAG ${_boost_ABI_TAG}s) set( _boost_ABI_TAG_DEBUG ${_boost_ABI_TAG_DEBUG}s) endif() # g = using debug versions of the standard and runtime support #libraries if(WIN32 AND MSVC) set( _boost_ABI_TAG_DEBUG ${_boost_ABI_TAG_DEBUG}g) endif() # y = using special debug build of Python #libraries etc. Then the actual find_library check could be simplified and the code would also be far more readable. Please feel free to complete the patch if you like this approach and have time. -- Philip Lowman ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMake macro problem
Hi, I have a problem with a self-written CMake macro, but I don't know exactly what the problem is. I have defined macro(SetIfElse var val def), which is supposed to assign the contents of val to var, when val is defined; otherwise it should assign the contents of def to var. This macro was inspired by the macro(SET_IF_NOT_SET var val) from the CMake module CTest.cmake When I feed the CMakeLists.txt file below to cmake, I would expect as output: 'text=Hello World', but instead I get 'text=Sorry mate!' Could you please explain what I'm doing wrong? project(hallo) cmake_minimum_required(VERSION 2.6) # Set variable ${var} equal to ${val} if ${val} is defined; else to ${def}. macro(SetIfElse var val def) if(DEFINED ${val}) set(${var} ${val}) else(DEFINED ${val}) set(${var} ${def}) endif(DEFINED ${val}) endmacro(SetIfElse) set(hello Hello World) set(mate Sorry mate!) SetIfElse(text ${hello} ${mate}) message(STATUS text=${text}) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMake not honoring ENV variable with MSYS
Not really sure if this is a CMake issue or and MSYS issue or operator error BUT when I run cmake -G MSYS Makefiles from an msys shell to configure my project there is one environment variable that is NOT being honored. The variable (MXADataModel_INSTALL) is defined in the My Computer-Properties- where I have it defined to C:\Developer\VS9\MXADataModel. Now, in my .bash_profile I redefine it to /c/Developer/GCC/MXADataModel. When I run cmake on my project I still get the VS9 path. I have several other variables defined the same way (EXPAT, TIFF, HDF5, QT-4.4.3) and all those variables are over-ridden correctly and all those variables will use the GCC path instead of the VS9 path when in an MSYS shell. I have checked the spelling, rewritten the .bash_profile a few different ways. I just don't see where I am screwing up for this one variable. Any help or places to look in my configurations would be helpful and very much appreciated. Thanks Mike Jackson ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake macro problem
Marcel Loose wrote: I have a problem with a self-written CMake macro, but I don't know exactly what the problem is. I have defined macro(SetIfElse var val def), which is supposed to assign the contents of val to var, when val is defined; otherwise it should assign the contents of def to var. This macro was inspired by the macro(SET_IF_NOT_SET var val) from the CMake module CTest.cmake When I feed the CMakeLists.txt file below to cmake, I would expect as output: 'text=Hello World', but instead I get 'text=Sorry mate!' Could you please explain what I'm doing wrong? project(hallo) cmake_minimum_required(VERSION 2.6) # Set variable ${var} equal to ${val} if ${val} is defined; else to ${def}. macro(SetIfElse var val def) if(DEFINED ${val}) set(${var} ${val}) else(DEFINED ${val}) set(${var} ${def}) endif(DEFINED ${val}) endmacro(SetIfElse) set(hello Hello World) set(mate Sorry mate!) SetIfElse(text ${hello} ${mate}) message(STATUS text=${text}) Isn't this asking if the variable Hello World (which, btw, I believe is not a valid variable name due to the space, although cmake is a touch inconsistent in handling such) is defined? I think what you want is: SetIfElse(text hello ${mate}) -- Matthew Please do not quote my e-mail address unobfuscated in message bodies. -- You are in a dark room. The only exit is a door to the east. OPEN DOOR I don't know which door you mean. OPEN EAST DOOR It's locked. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake not honoring ENV variable with MSYS
What do set and export report from your MSYS prompt as the value of MXADataModel_INSTALL? Is there a leftover CMake cache value for MXADataModel_INSTALL from before you set the env in your .bash_profile? Perhaps something else does a SET(ENV{MXADataModel_INSTALL} VS9 path) for you...? On Fri, Feb 13, 2009 at 11:55 AM, Mike Jackson mike.jack...@bluequartz.netwrote: Not really sure if this is a CMake issue or and MSYS issue or operator error BUT when I run cmake -G MSYS Makefiles from an msys shell to configure my project there is one environment variable that is NOT being honored. The variable (MXADataModel_INSTALL) is defined in the My Computer-Properties- where I have it defined to C:\Developer\VS9\MXADataModel. Now, in my .bash_profile I redefine it to /c/Developer/GCC/MXADataModel. When I run cmake on my project I still get the VS9 path. I have several other variables defined the same way (EXPAT, TIFF, HDF5, QT-4.4.3) and all those variables are over-ridden correctly and all those variables will use the GCC path instead of the VS9 path when in an MSYS shell. I have checked the spelling, rewritten the .bash_profile a few different ways. I just don't see where I am screwing up for this one variable. Any help or places to look in my configurations would be helpful and very much appreciated. Thanks Mike Jackson ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake not honoring ENV variable with MSYS
From some experimentation and some anecdotal evidence on the internet it would seem that environment variables need to be ALL CAPITALS or MSYS will NOT pick them up. Odd. And in fact changing MXADataModel_INSTALL to MXADATAMODEL_INSTALL in the My Computer settings and in my .bash_profile allows the proper over ride when I am using msys. Odd. Thanks for the help Mike David Cole wrote: What do set and export report from your MSYS prompt as the value of MXADataModel_INSTALL? Is there a leftover CMake cache value for MXADataModel_INSTALL from before you set the env in your .bash_profile? Perhaps something else does a SET(ENV{MXADataModel_INSTALL} VS9 path) for you...? On Fri, Feb 13, 2009 at 11:55 AM, Mike Jackson mike.jack...@bluequartz.netwrote: Not really sure if this is a CMake issue or and MSYS issue or operator error BUT when I run cmake -G MSYS Makefiles from an msys shell to configure my project there is one environment variable that is NOT being honored. The variable (MXADataModel_INSTALL) is defined in the My Computer-Properties- where I have it defined to C:\Developer\VS9\MXADataModel. Now, in my .bash_profile I redefine it to /c/Developer/GCC/MXADataModel. When I run cmake on my project I still get the VS9 path. I have several other variables defined the same way (EXPAT, TIFF, HDF5, QT-4.4.3) and all those variables are over-ridden correctly and all those variables will use the GCC path instead of the VS9 path when in an MSYS shell. I have checked the spelling, rewritten the .bash_profile a few different ways. I just don't see where I am screwing up for this one variable. Any help or places to look in my configurations would be helpful and very much appreciated. Thanks Mike Jackson ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMake not honoring ENV variable with MSYS
Interesting ProgramFiles, SystemRoot and other pre-defined Windows env vars show up as mixed case in my Windows cmd prompt, but in the MSYS prompt, all env vars are all caps. That is odd. Even odder that I never noticed that before... On Fri, Feb 13, 2009 at 12:36 PM, Mike Jackson mike.jack...@bluequartz.netwrote: From some experimentation and some anecdotal evidence on the internet it would seem that environment variables need to be ALL CAPITALS or MSYS will NOT pick them up. Odd. And in fact changing MXADataModel_INSTALL to MXADATAMODEL_INSTALL in the My Computer settings and in my .bash_profile allows the proper over ride when I am using msys. Odd. Thanks for the help Mike David Cole wrote: What do set and export report from your MSYS prompt as the value of MXADataModel_INSTALL? Is there a leftover CMake cache value for MXADataModel_INSTALL from before you set the env in your .bash_profile? Perhaps something else does a SET(ENV{MXADataModel_INSTALL} VS9 path) for you...? On Fri, Feb 13, 2009 at 11:55 AM, Mike Jackson mike.jack...@bluequartz.netwrote: Not really sure if this is a CMake issue or and MSYS issue or operator error BUT when I run cmake -G MSYS Makefiles from an msys shell to configure my project there is one environment variable that is NOT being honored. The variable (MXADataModel_INSTALL) is defined in the My Computer-Properties- where I have it defined to C:\Developer\VS9\MXADataModel. Now, in my .bash_profile I redefine it to /c/Developer/GCC/MXADataModel. When I run cmake on my project I still get the VS9 path. I have several other variables defined the same way (EXPAT, TIFF, HDF5, QT-4.4.3) and all those variables are over-ridden correctly and all those variables will use the GCC path instead of the VS9 path when in an MSYS shell. I have checked the spelling, rewritten the .bash_profile a few different ways. I just don't see where I am screwing up for this one variable. Any help or places to look in my configurations would be helpful and very much appreciated. Thanks Mike Jackson ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Hi Beginner to Cmake and ITK
You should start with the CMake manual, I think. Here you can find everything you need to start developing with CMake: http://www.cmake.org/Wiki/CMake -- Best regards, Sergey Rudchenko On Fri, 2009-02-13 at 09:38 -0800, neel vinoth wrote: Hi All, I am jumping into ITK. Downloaded following tools: Files available : Cmake-2.4.8.zip Cmake-2.4.8-win32-x86.zip InsightToolkit-3.10.1.zip Micro soft Visual Studio 2008 I am interested to install the above software and run my first program using Cmake. Please guide me. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] include_regular_expression question(Ubuntu CMake-2.6-patch0)
Hi folks, I'm new to CMake and quite happy about it(especially after having tried SCons and WAF), thank you guys, you're doing great job. The only issue bothering me at the moment is include_regular_expression command which I can't make work properly. I'm developing quite a large project which bundles sources of boost and some other large libs. What I want to achieve is to exclude certain paths which change infrequently(boost is among of those paths) from dependency checking resolver. Basically, I'm trying the following command: include_regular_expression((projectA|projectB|projectC)) ...and it looks like it's not working properly, depend.make still contains lots of unnecessary entries. Am I missing something? Thanks in advance. P.S It would be very cool to have exclude_regular_expression as well in some future version of CMake ;) -- Best regards, Pavel ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake