Re: [CMake] feed parsed information from source files into compile process
On Wed, Feb 09, 2011 at 05:24:28PM +0100, Verweij, Arjen wrote: Currently there is a python script that does preprocessing of all source, stores information in override.cmake files using set_source_file_properties(). This works fine, but makes maintaining source more error prone than it was. For instance a developer might use the code for an FE element, use it as the basis for a collapsed version and inherit specific optimizations which are now ignored. I have looked at a way to chain this step using add_custom_command(), but I see no possibility to tell the generator about some variable an external program will fill in during the build phase. You can't use add_custom_command() to drive this because the results of any custom commands will only be available at build time. You need stuff to happen at CMake configure time. Hence, I would use execute_process() to run your python script at configure time. It would deposit its results into a file, which you could then include() (or file(READ ...)). hth, tyler ___ 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] Automatic out of source build's possible?
On Tue, Feb 08, 2011 at 04:56:26AM -0500, Martin O'Brien wrote: I definitely can't rely on the people who are complaining about having to do the -D... to have the correct version installed, or even to recognize when they don't, probably, and if I give them this option, they're going to write scripts that depend on it. The basic problem is that although the users in question think of themselves as developers, they're really not. They're more IT'ish, involved in doing things like configuring continuous integration servers, and I already get calls over things like CMAKE_MINIMUM_REQUIRED() that they really ought to be able to figure out on their own. So your question boils down to how do I support users who won't read documentation or act on error messages in a useful way? Let me know when you solve that one and I'll nominate you for some kind of prize in software engineering :). Anyway, as someone with an IT'ish background who does menial things like configure CI servers, my advice probably isn't worth much to a real developer like yourself. I'll go back to studying CMAKE_MINIMUM_REQUIRED(). tyler ___ 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] The CMake bug tracker and the backlog of unresolved issues
(removing cmake-developers; cross-posting felt wrong) On Thu, Feb 03, 2011 at 05:34:45PM -0500, David Cole wrote: Since we do not have a status of backlog -- but we don't really use the status values of acknowledged or confirmed very much, I am thinking we could define backlog as: status=acknowledged AND assigned to= (empty string, none) WORKSFORME[1]. Is there a way to display a note about this non-standard convention of the CMake bug tracker on the bug tracker itself? I could see new users being a little confused. Thanks, tyler [1] There are many things I do not miss about Bugzilla, but I've always liked WORKSFORME and I really miss the blunt yet economical WONTFIX. ___ 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] link against a library under windows
On Mon, Jan 31, 2011 at 08:12:49AM +0100, ycollette.nos...@free.fr wrote: if (MKL_FOUND) set(LINK_PATHS ${LINK_PATHS} ${mkl_solver_PATH}) endif (MKL_FOUND) if (MPI_FOUND) set(LINK_PATHS ${LINK_PATHS} ${MPI_BASE_PATH}/lib) endif (MPI_FOUND) link_directories(${LINK_PATHS}) Don't use link_directories(). Instead pass the full path to target_link_libraries(). set(LINK_LIBS odbc32 libifport libifcore) if (MKL_FOUND) set(LINK_LIBS ${LINK_LIBS} ${ATLAS_LIBRARIES}) endif (MKL_FOUND) if (MPI_FOUND) set(LINK_LIBS ${LINK_LIBS} fmpich2) endif (MPI_FOUND) target_link_libraries(arc2d ${LINK_LIBS}) Now, if I build my project, there is a link error because a lot of symbols are not found. If I do a nmake VERBOSE=1, I see that the link command has only the last library: fmpich2. You may also be interested in list(... APPEND ...). Maybe you need quotes to insure that LINK_LIBS is set correctly the way you're doing it? So, my question is: how do I add several libraries in the command target_link_libraries and how do I add several paths in link_directories under windows ? Your approach is fine. I would inspect the value of LINK_LIBS that is passed to target_link_libraries() to make sure it's what you expect it to be. Do I need to add a .lib string to each libraries ? No. Do I need to add the complete path to each libraries ? No, but it is highly recommended. hth, tyler ___ 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] using svn credentials inside ctest script
On Fri, Jan 28, 2011 at 06:22:37AM -0500, David Cole wrote: Storing credentials on the machine in advance is one way to achieve this. (I have not tried this myself, but...) You may also be able to set the CTEST_UPDATE_COMMAND to a script that delegates to svn with all your desired command line options. Another good potential workaround. work. Certainly, what you're trying to do is reasonable. Although one could argue it might be better to cache credentials on machines than save them in plain text in a script file. FYI and IIRC, Subversion (as of 1.6 at least) generally stores the credentials on disk in plain text. I don't remember if there are any strong encryption options, but I don't think so; this was a frequent complaint on the svn-user list when I was subscribed there. Still might be better than storing credentials in revision control, but probably not really really secure either. tyler ___ 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] using svn credentials inside ctest script
On Thu, Jan 27, 2011 at 04:11:35AM -0800, girish hilage wrote: find_program(CTEST_SVN_COMMAND NAMES svn) set(CTEST_UPDATE_COMMAND ${CTEST_SVN_COMMAND}) set(CTEST_UPDATE_OPTIONS --username my_svn_username --password my_svn_password) ctest_update(RETURN_VALUE updateRV) But, when I give 'ctest -S script.cmake', it again asks for the svn password eventhough I have hard-coded svn username and password in script.cmake. My requirement is that, I am setting up a cronjob for nightly builds and I do not want it to ask for an svn password. In the output I can see following lines : SetCTestConfigurationFromCMakeVariable:UpdateCommand:CTEST_UPDATE_COMMANDSetCTestConfiguration:UpdateCommand:/usr/bin/svn SetCTestConfigurationFromCMakeVariable:UpdateOptions:CTEST_UPDATE_OPTIONSSetCTestConfiguration:UpdateOptions:--username my_svn_username --password my_svn_password SetCTestConfigurationFromCMakeVariable:SVNCommand:CTEST_SVN_COMMANDSetCTestConfiguration:SVNCommand:/usr/bin/svn Your code looks reasonable to me. Have you tried sticking the OPTIONS directly into CTEST_UPDATE_COMMAND? You could also let Subversion handle the username/password; it will cache them if ask it to. The advantage is that you don't have to hardcode passwords into your build scripts. The disadvantage is this is something you'll need to take care of for all machines/accounts that do automated builds. tyler ___ 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] using svn credentials inside ctest script
On Thu, Jan 27, 2011 at 08:40:14AM -0800, Tyler Roscoe wrote: On Thu, Jan 27, 2011 at 04:11:35AM -0800, girish hilage wrote: find_program(CTEST_SVN_COMMAND NAMES svn) set(CTEST_UPDATE_COMMAND ${CTEST_SVN_COMMAND}) set(CTEST_UPDATE_OPTIONS --username my_svn_username --password my_svn_password) ctest_update(RETURN_VALUE updateRV) But, when I give 'ctest -S script.cmake', it again asks for the svn password eventhough I have hard-coded svn username and password in script.cmake. My requirement is that, I am setting up a cronjob for nightly builds and I do not want it to ask for an svn password. In the output I can see following lines : SetCTestConfigurationFromCMakeVariable:UpdateCommand:CTEST_UPDATE_COMMANDSetCTestConfiguration:UpdateCommand:/usr/bin/svn SetCTestConfigurationFromCMakeVariable:UpdateOptions:CTEST_UPDATE_OPTIONSSetCTestConfiguration:UpdateOptions:--username my_svn_username --password my_svn_password SetCTestConfigurationFromCMakeVariable:SVNCommand:CTEST_SVN_COMMANDSetCTestConfiguration:SVNCommand:/usr/bin/svn Your code looks reasonable to me. Have you tried sticking the OPTIONS directly into CTEST_UPDATE_COMMAND? You could also let Subversion handle the username/password; it will cache them if ask it to. The advantage is that you don't have to hardcode passwords into your build scripts. The disadvantage is this is something you'll need to take care of for all machines/accounts that do automated builds. One other thing that I had to discover myself and which I haven't noticed in any CTest documentation: # 'update' and '--non-interactive' are automatically added to # CTEST_UPDATE_COMMAND by CTest. So maybe --non-interactive is interfering with --username/--password? It shouldn't but it's another thing to test. tyler ___ 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] ctest returns 255 after running ctest_test() if no tests are available
I have a CTest script that I use to drive dashboard builds. CTest scripts return 0 (success) if everything works right, or non-zero (failure; I'm getting 255 in this particular case on Linux) if something goes wrong. The problem I'm having is that I call ctest_test() in this script and I have one platform where we don't build and run unit tests: opensuse 9, which includes gcc 3.3.x, which is not supported by googletest, so we just disable the building and running of unit tests on this platform. The problem is that CTest considers this to be an error condition: Test project /satsop/build/kitt-cmake-based-addons-for-legacy-trunk/binary/addons/trunk/linux64.26/release Constructing a list of tests Done constructing a list of tests Checking test dependency graph... No tests were found!!! and upon reaching the end of the script, it exits with an error: Error in read script: /satsop/build/kitt-cmake-based-addons-for-legacy-trunk/kitt.cmake Is this a bug? It seems to me that calling ctest_test() on a project with no tests added via add_test() is not an erroneous condition. Is there a way to tell CTest not to freak out about the lack of tests? Is there a way to ask CTest how many tests are available? If so, I could skip calling ctest_test() unless that number is non-zero. I can't just spare out the call to ctest_test() for this platform as certain products have non-unittest tests that I still want to run via ctest_test(). I would have to do a test like: if (PLATFORM MATCHES opensuse9 AND PRODUCT_NAME MATCHES addons) set (do_not_run_tests TRUE) endif () which is undesirable. Any other ideas on how I can proceed here? Thanks, tyler ___ 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] How to assign data from subexpressions of regular expressions to CMake variables?
On Thu, Jan 20, 2011 at 02:06:33PM +0100, Michael Wild wrote: Ah, yes. I keep forgetting. Might I propose that the documentation about regular expressions be extracted into its own section and then be referenced from all commands that have a REGEX mode? Because, confusingly, the only documentation about regular expression is at the end of the string(REGEX REPLACE) command, but then uses if(... MATCHES ...) as an example. For the reader of the if( MATCHES ) documentation, this isn't very discoverable, it doesn't even refer him to the string(REGEX REPLACE) command. Not that I'm signing up for this job, but +1 on this suggestion. tyler ___ 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] continuous builds and CTEST_ELAPSED_TIME
On Thu, Jan 20, 2011 at 08:38:41PM +, Marco Craveiro wrote: the bit i fail to understand is why is 36000 deemed as a good value rather than ~86400? or is this because a lot of people have copied and pasted from the wiki page? :-) Since the examples come from scripts Kitware uses in production, my guess to the origin of 10 hours is that this time period was useful for Kitware's specific circumstances. As to why everyone uses that number, I think your guess is exactly right. tyler ___ 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 and shell commands
On Mon, Jan 17, 2011 at 06:24:58PM +, mark...@email.it wrote: ln -s lib/libfreenect.so.0.0 lib/libfreenect.so For this specific problem, check out: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:SOVERSION Should I use: add_custom_command ? For the general problem of running arbitrary commands that CMake doesn't already know how to do, add_custom_command() is the right track. ___ 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] packaging after success testing
On Fri, Jan 07, 2011 at 12:52:58PM +0100, ycollette.nos...@free.fr wrote: A while ago, a question similar to this one was posted, but no answer was given. Link? Is it possible to perform the packaging part of a project only if the testing part has been successfully performed ? I do this in the CTest script that drives dashboard builds. Not sure if this is what you want as your question is so vague, but in case it helps: ... # Start a new submission. ctest_start (${TP_DASHBOARD_MODEL}) # Calculate TP_CTEST_XML_DIR (which changes whenver ctest_start() is called). file (READ ${CTEST_BINARY_DIRECTORY}/Testing/TAG tag_file) string (REGEX MATCH [^\n]* xml_dir ${tag_file}) set (TP_CTEST_XML_DIR ${CTEST_BINARY_DIRECTORY}/Testing/${xml_dir}) ... # This section courtesy of Clinton Stimpson. It determines whether # the tests passed or not. See # http://permalink.gmane.org/gmane.comp.programming.tools.cmake.user/27268 # tests_result contains whether ctest was able to run tests, not # whether any tests failed. # # This section mines the test results XML file generated by CTest and # figures out if there were test failures. See also: # http://public.kitware.com/Bug/view.php?id=8277 set (tests_passed 0) if (tests_result MATCHES 0) file (READ ${TP_CTEST_XML_DIR}/Test.xml TEST_RESULTS) string (REGEX MATCH Status=\[^p] TestErrors ${TEST_RESULTS}) if (TestErrors MATCHES ) set (tests_passed 1) endif () endif () ... if (tests_passed) # Build and test succeeded, so build an install package and publish this build. # Package. Append results to existing build. if (TP_PACKAGE) tp_build (package APPEND) else () message (INFO: Packaging disabled.) endif () [Stanza about publishing, aka copying build artifacts to the archive for later use, goes here using a similar pattern.] ... hth, tyler ___ 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] how to submit customized test report
On Mon, Jan 03, 2011 at 05:48:13AM -0800, girish hilage wrote: So, now I have to edit Test.xml generated by 'ctest' under directory : /home/girish/project/trunk/Testing/20110103-1027/ What I would like to know is, if there is any 'CTEST_' variable which would give me path of the Test.xml file that is generated by 'ctest'? Or is there any variable which will give me 'Experimental tag' which is shown in the output (Use Experimental tag: 20110103-1027) if we give -VV option to ctest, so that I can construct path to Test.xml? Or can we ask 'ctest' to generate Test.xml at some pre-specified path? Not 100% certain of your problem, but I think you're looking for something like this: # Start a new submission. ctest_start (${TP_DASHBOARD_MODEL}) # Calculate TP_CTEST_XML_DIR (which changes whenver ctest_start() is # called). file (READ ${CTEST_BINARY_DIRECTORY}/Testing/TAG tag_file) string (REGEX MATCH [^\n]* xml_dir ${tag_file}) set (TP_CTEST_XML_DIR ${CTEST_BINARY_DIRECTORY}/Testing/${xml_dir}) The idea for this comes from Clinton Stimpson. See also: http://permalink.gmane.org/gmane.comp.programming.tools.cmake.user/27268 hth, tyler ___ 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] echo in execute_process
On Fri, Dec 24, 2010 at 04:19:16AM +, luxInteg wrote: in an execute_process() function with ${ECHO} (/bin/echo)what does one set for WORKING_DIRECTORY? 1. I would use ${CMAKE_COMMAND} -E echo rather than /bin/echo. 2. I would not set WORKING_DIRECTORY unless I needed it for some reason. If I needed it, wouldn't it be pretty obvious which directory to use? tyler ___ 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] Most convenient way to pass information from dashboard script to cmake script
On Mon, Dec 27, 2010 at 03:56:20PM +0100, Wojciech Migda wrote: I'm trying to pass information from a script executed for dashboard submission (ctest -S) to the underlying CMakeLists.txt which is to be parsed by (internally called by ctest) cmake. In other words, I'd like to have a system which will behave differently when configured directly through direct cmake invocation and through ctest -S script execution. Kitware does this in its ctest -S script for doing dashboard builds of CMake. I took that some time ago and modified it, so now the relevant sections look like this: # Set up dashboard_cache, a string containing var=value pairs that will be # written into the initial CMakeCache.txt. # # Careful with quoting and newlines here. Unquoted spaces will cause CMake # to interpret this variable as a list, resulting in a spurious semicolon # in the resulting CMakeCache.txt (which doesn't work; CMake will ignore these # cache entries). Leading whitespace appears to be ok, so we can preserve the # indentation in this file even though that whitespace is quoted and included # in the dashboard_cache variable. if (NOT DEFINED dashboard_cache) set (dashboard_cache BUILD_run_unittest_during_build:BOOL=OFF BUILD_code_quality:BOOL=${BUILD_code_quality} TP_ARCHIVE_TYPE:STRING=${TP_ARCHIVE_TYPE} TP_PACKAGE:BOOL=${TP_PACKAGE} TP_PACKAGE_WITH_INSTALLSHIELD:BOOL=${TP_PACKAGE_WITH_INSTALLSHIELD} TP_PUBLISH:BOOL=${TP_PUBLISH} TP_EXERCISE:BOOL=${TP_EXERCISE} TP_EXERCISE_QUICK:BOOL=${TP_EXERCISE_QUICK} TP_WINDOWS_USE_PRECOMPILED_HEADERS:BOOL=${TP_WINDOWS_USE_PRECOMPILED_HEADERS} ) # We only add these values to the cache if they are defined. If they are # undefined, we let the configure step set up defaults later on. if (DEFINED TP_CODE_QUALITY_MAX_CRAP_VALUE) set (dashboard_cache ${dashboard_cache} TP_CODE_QUALITY_MAX_CRAP_VALUE:STRING=${TP_CODE_QUALITY_MAX_CRAP_VALUE} ) endif () endif () [...] # Helper macro to write the initial cache. macro (write_cache) if (CTEST_CMAKE_GENERATOR MATCHES Make) set (cache_build_type CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}) endif () file (WRITE ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt SITE:STRING=${CTEST_SITE} BUILDNAME:STRING=${CTEST_BUILD_NAME} ${cache_build_type} ${dashboard_cache} ) endmacro () [...] if (NOT EXISTS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) set (dashboard_fresh 1) message (INFO: No CMakeCache.txt found in binary directory ${CTEST_BINARY_DIRECTORY}. Writing new cache and starting fresh build.) write_cache () endif () hth, tyler ___ 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] Please Help - Find HDF5 module on windows isn't finding
On Tue, Dec 21, 2010 at 10:04:25AM -0700, Aaron R wrote: I'm trying to setup a cmake project on windows which needs the HDF5 library. I put the prebuilt libraries under c:\hdf5-1.8.5-win32. I set HDF5_ROOT in the cmakelists file and then called find(HDF5). Its not finding it. I've tried specifying components as well and still nothing. You can add some message() commands to FindHDF5.cmake to inspect things. You could also try cmake --trace to get debug output (note: the output is extremely verbose). tyler ___ 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] BundleUtilities example not working under Windows?
On Tue, Dec 21, 2010 at 07:11:36PM +0100, Crni Gorac wrote: Am trying to employ fixup_bundle(), in order to be able to create installers for my Qt-dependent application on Mac and Windows. I have it working fine under Mac, but on Windows it is not working either with my application, or by example from CMake Wiki pages: http://www.cmake.org/Wiki/BundleUtilitiesExample. Namely, Qt DLL are not included in the installer; what is strange is that example project from above page manages to have Qt plugins included (my project is not using plugins). So - any help here, is this example maybe outdated or something else (am using CMake 2.8.3)? It's impossible to say what's going wrong without details. What does the output from fixup_bundle look like? How do you call fixup_bundle from your CMakeLists? tyler ___ 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] Questions about FFTW as an External Project within ITK
On Fri, Dec 17, 2010 at 10:40:30AM -0600, kent williams wrote: install(FILES ${CMAKE_BINARY_DIR}/FFTW/lib/libfftw3.a DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) install(FILES ${CMAKE_BINARY_DIR}/FFTW/include/fftw3.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include) I'm thinking thats kind of awful, but I don't know of a more elegant solution. I also don't know the CMake variable to use for the library file extension. This is what fixup_bundle() in GetPrerequisites.cmake is for. 2. I don't know how to make the Algorithms library depend on the FFTW external project. If I do a sequential build, FFTW does get built before everything else, but if I do a parallel build, FFTW builds concurrent with the rest of ITK. This could definitely fail. If you're using FFTW as an external project, can't you just use add_dependencies() to enforce the proper order? tyler ___ 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] Trying to setup make folder configuration on linux
On Fri, Dec 10, 2010 at 08:11:45PM +0100, Louis Hoefler wrote: -- Build files have been written to: /root/massmailer/Debug Probably not a good idea to be doing this kind of thing as root. [100%] Built target massmailer -- Configuring done -- Generating done -- Build files have been written to: /root/massmailer/Release [100%] Built target massmailer Install the massmailer release now [Yes/n]? Yes [100%] Built target massmailer Install the project... -- Install configuration: Release CMake Error at massmailer/cmake_install.cmake:36 (FILE): file INSTALL cannot find /root/massmailer/massmailer/massmailer. Call Stack (most recent call first): cmake_install.cmake:37 (INCLUDE) We'll need to see your CMakeLists.txt to help further, but it's likely that you got a path wrong in your install() command. hth, tyler ___ 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] test property COST not working in cmake 2.8.3?
Ok I've added a link to this thread and the patch below to the bug: http://www.vtk.org/Bug/view.php?id=11561 Without feedback from anyone, I will assume that I have done an awesome, production-ready job and will await the call for patches to add to CMake 2.8.4. Thanks, tyler On Tue, Dec 07, 2010 at 09:37:09PM -0800, Tyler Roscoe wrote: In the process of attempting to fix this, I learned a lot of stuff about how COST is handled that I've never encountered in the docs. Am I missing something? Here are some notes I made about the behavior of COST in CTest. If others find them useful, I'd be happy to put them in the Wiki if someone could nominate an appropriate place. - Any COST property you set on a test is only a starting point. CTest calculates an average cost value for a test each time that test is run. This value is cached in Testing/Temporary/CTestCostData.txt. - Tests that fail are also stored in Testing/Temporary/CTestCostData.txt. On the next run, these tests have their cost set to the maximum to insure that they are run first. I believe this factors into later averaging, so that tests that fail more frequently run earlier than tests that faill less frequently. So, my solution. I've tried to implement Zach's suggested middle ground. For non-parallel CTest runs: - The run failed tests first behavior is disabled to prevent failed tests from clobbering their given COST property. - The stored values in CTestCostData.txt are not used. - As long as std::sort() is stable, the COST for each test should remain 0 and the tests should run in the order encountered in CMakeLists.txt. For parallel CTest runs, failed tests run first and the moving average is calculated and used. I think it makes sense that if you ask for tests to run in parallel, you probably don't care so much about the order (modulo test dependencies) so it is more reasonable to throw out the COST data provided by the CMakeLists.txt. I'm not really a C++ dev so please let me know if I'm way off base. This patch appears to solve my immediate problem but if it can be included upstream that is better for everyone. The patch is against the 2.8.3 release. I've also included a simple CMakeLists.txt for testing and verifying behavior. Unpatched ctest 2.8.3 runs the tests in reverse order. Patched ctest runs them according to COST. ## ### PATCH ## --- ./Source/CTest/cmCTestMultiProcessHandler.cxx.orig 2010-12-07 15:31:57.091228582 -0800 +++ ./Source/CTest/cmCTestMultiProcessHandler.cxx 2010-12-07 19:59:11.115740666 -0800 @@ -434,9 +434,14 @@ if(index == -1) continue; this-Properties[index]-PreviousRuns = prev; - if(this-Properties[index] this-Properties[index]-Cost == 0) + // When not running in parallel mode, don't clobber test's cost with + // running average. + if(this-ParallelLevel 1) { -this-Properties[index]-Cost = cost; +if(this-Properties[index] this-Properties[index]-Cost == 0) + { + this-Properties[index]-Cost = cost; + } } } // Next part of the file is the failed tests @@ -475,20 +480,23 @@ { SortedTests.push_back(i-first); -//If the test failed last time, it should be run first, so max the cost -if(std::find(this-LastTestsFailed.begin(), - this-LastTestsFailed.end(), - this-Properties[i-first]-Name) - != this-LastTestsFailed.end()) +//If the test failed last time, it should be run first, so max the cost. +//Only do this for parallel runs; in non-parallel runs, avoid clobbering +//the test's original cost. +if(this-ParallelLevel 1) { - this-Properties[i-first]-Cost = FLT_MAX; + if(std::find(this-LastTestsFailed.begin(), + this-LastTestsFailed.end(), + this-Properties[i-first]-Name) + != this-LastTestsFailed.end()) +{ +this-Properties[i-first]-Cost = FLT_MAX; +} } } - if(this-ParallelLevel 1) -{ + TestComparator comp(this); std::sort(SortedTests.begin(), SortedTests.end(), comp); -} } //- ## ### TEST CASE ## cmake_minimum_required(VERSION 2.8) project(p) enable_testing() # Add in reverse order to make sure COST rather than order of add_test() # commands really controls execution order. add_test (i_should_run_fifth ${CMAKE_COMMAND} -E echo i should run fifth) set_tests_properties (i_should_run_fifth PROPERTIES COST -100) add_test (i_should_run_fourth ${CMAKE_COMMAND} -E echo i should run fourth) set_tests_properties (i_should_run_fourth PROPERTIES COST -1) add_test (i_should_run_third ${CMAKE_COMMAND} -E echo i
Re: [CMake] Did anyone manage to get incremental linking working with NMake generator?
On Thu, Dec 09, 2010 at 08:44:15AM -0500, Bill Hoffman wrote: On 12/9/2010 5:26 AM, Gabriel Petrovay wrote: Thanks Bill for the trick. Unfortunately this works only for exe targets. It doesn't work for dll's. Moreover, before the link command there is this output: Visual Studio Non-Incremental Link If it says that then the /INCREMENTAL flag is not being used. You have to set the CMAKE_SHARED_LINKER_FLAGS_DEBUG flag for this to work with dlls, may also want to set this one: CMAKE_MODULE_LINKER_FLAGS_DEBUG. Haven't been following this thread closely, but changing the handling of /INCREMENTAL is a pain, at least in VS 2005 and 2008. Here is some code we use to *disable* /INCREMENTAL. With a little creativity, you could probably use this to forcibly *enable* /INCREMENTAL :): # Disable incremental linking when BUILD_code_quality is enabled as it # causes problems with code coverage builds. # # These link flags are baked in when Windows-cl.cmake is loaded. Thus, # we have to alter several variables. See: How to turn off incremental # linking for MSVC Debug and RelWithDebInfo targets? # http://www.cmake.org/pipermail/cmake/2010-February/035174.html # # Example from OpenSceneGraph: # http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.6.0/CMakeLists.txt # # Also remove /EDITANDCONTINUE, which is incompatible with # /INCREMENTAL:NO. foreach (flag_type EXE MODULE SHARED) string (REPLACE INCREMENTAL:YES INCREMENTAL:NO flag_tmp ${CMAKE_${flag_type}_LINKER_FLAGS_DEBUG}) string (REPLACE /EDITANDCONTINUE flag_tmp ${CMAKE_${flag_type}_LINKER_FLAGS_DEBUG}) set (CMAKE_${flag_type}_LINKER_FLAGS_DEBUG /INCREMENTAL:NO ${flag_tmp} CACHE STRING Overriding default debug ${flag_type} linker flags. FORCE) mark_as_advanced (CMAKE_${flag_type}_LINKER_FLAGS_DEBUG) endforeach () # Change /ZI to /Zi as /ZI implies /EDITANDCONTINUE, which is mutually # exclusive with INCREMENTAL:NO as set above. Furthermore, this setting # only applies to 32-bit Windows. if (TP_PLATFORM MATCHES ${TP_WIN32}) string (REPLACE /ZI /Zi CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) endif () # Disable this warning: # warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other # libs; use /NODEFAULTLIB:library list (APPEND TP_COMMON_LINK_FLAGS_DEBUG /NODEFAULTLIB:MSVCRT) hth, tyler ___ 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 2.8.4 release scheduled for next month
So are you ready to start collecting candidate bugs for 2.8.4? I nominate this one! http://www.vtk.org/Bug/view.php?id=11561 Thanks, tyler On Thu, Dec 09, 2010 at 03:37:16PM -0500, David Cole wrote: We are still planning to start the release candidate cycle for CMake 2.8.4 on Wed. Jan. 12, 2011. Because of that, all changes to be considered for inclusion in the -rc1 build should be pushed to the stage and merged to 'next' before the nightly start time on the evening of Mon. Jan. 10, 2011. ___ 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 2.8.4 release scheduled for next month
On Thu, Dec 09, 2010 at 04:09:49PM -0500, David Cole wrote: No: we were ready to start collecting candidate bugs a month and a half ago. That list is now what you see on the roadmap page: http://public.kitware.com/Bug/roadmap_page.php Guess I got my wires crossed. I still believe the bug I reported is a regression, so maybe it can get through the gate regardless. Thanks, tyler ___ 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] Pass exclude test regex in visual studio
On Tue, Dec 07, 2010 at 02:39:18AM -0600, j s wrote: Is there a way to pass the ctest -E flag to a visual studio 10 configuration to prevent certain tests from running in the regressions? I don't know of a good way (and I'm not 100% sure what you mean by prevent certain tests from running in the regressions) but what I usually do is just edit the command associated with the RUN_TESTS target and add command-line args (-E, -VV) there. If you have a permanent set you like to exclude, you can just create your own target MY_RUN_TESTS or whatever that runs ${CMAKE_CTEST_COMMAND} with your preferred arguments. hth, tyler ___ 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] test property COST not working in cmake 2.8.3?
(i_should_fail_and_run_second_or_first ${CMAKE_COMMAND} -E echo i should fail and run second) set_tests_properties (i_should_fail_and_run_second_or_first PROPERTIES WILL_FAIL TRUE COST 50 ) On Thu, Dec 02, 2010 at 08:54:12AM -0800, Tyler Roscoe wrote: I've taken the liberty of adding this bug to the tracker: http://www.cmake.org/Bug/view.php?id=11561 ___ 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] test property COST not working in cmake 2.8.3?
I've taken the liberty of adding this bug to the tracker: http://www.cmake.org/Bug/view.php?id=11561 Can someone give me an idea of how involved this fix is? If it cannot be fixed in short order, I'll be forced to hack around the change in COST's behavior in my own scripts. Fixing the problem at its source would obviously be preferable for me. Thanks, tyler On Tue, Nov 30, 2010 at 12:14:56PM -0800, Tyler Roscoe wrote: On Tue, Nov 30, 2010 at 01:29:37PM -0500, Zach Mullen wrote: Hm, yours was a use case we didn't really consider when we were making changes to cost behavior. Clearly. :) The middle ground here would be to respect costs in the non-parallel case when they are expressed explicitly This sounds good. but not to cost-order them automatically based on their previous run times. I don't care too much about this behavior, but it seems like a nice feature. Perhaps if CTest reserved a range for its own COST data (-10 = CTest-calculated COST = 10?) then users could use costs -10 or 10 to insure ordering of certain tests? So what are the next steps? Should I open a bug to track this issue? Is this an easy change (so easy a monkey like me can do it) or can someone at Kitware take care of it? I am able and eager to test a CMake nightly build that fixes this bug/regression/misunderstanding. Thanks, tyler On Tue, Nov 30, 2010 at 12:43 PM, Tyler Roscoe ty...@cryptio.net wrote: On Fri, Nov 26, 2010 at 10:38:44AM -0500, Zach Mullen wrote: I just realized why this isn't working -- it's actually not a regression. Maybe we have different definitions of regression. I see a feature that used to do one thing but which now does something else. Here is what the docs say about the COST property: # COST: Set this to a floating point value. Tests in a test set will be # run in descending order of cost. This property describes the cost of a test. You can explicitly set this value; tests with higher COST values will run first. I don't see anything there about parallel or non-parallel runs. It seems to me that if I set the COST property, I should be able to control the order in which tests run, period. So at the very least, the docs should be updated if you intend to change the behavior. In this release we decided that the costs should only be taken into account in a parallel case (ctest -j N). Many users have implicit dependencies based on the order of their add_test calls, so we didn't want to break backward compatibility for those not using parallel ctest. It looks like ctest -j2 is respecting COST. Currently I have several tests that cannot run at the same time as others (they touch the same resources and/or running two of them at once would crush the machine). If I could get the old COST behavior by running ctest -j1, that might be an acceptable workaround, but it does not appear to work today. The non-parallel way to specify a test to run last is simply to make it the last add_test call. My CMake projects are modular (I imagine this is true for many CMake users). Each module is responsible for adding its own unit tests and code quality checks. As I said in my initial email, the code quality checks must run after the unit tests so that accurate code coverage values can be calculated. I can try to insure that my add_unittest() functions all run before my add_code_quality() functions, but that seems brittle and error-prone. It was much nicer when I could just tell add_code_quality() to add all its tests with COST -1000 to guarantee they run after everything else. I can imagine ways to work around this problem, but they all seem rather clunky, especially when COST used to solve the problem so simply and elegantly. I hope we can reach a useful middle ground about the future of the COST property. In its current state, it is of no use to me. Thanks, tyler On Fri, Nov 26, 2010 at 10:20 AM, Zach Mullen zach.mul...@kitware.com wrote: On Tue, Nov 23, 2010 at 6:02 PM, David Cole david.c...@kitware.com wrote: It might be due to this commit: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=142edf8ad4baccd991a6a8a3e5283d0b575acca2 (first released in 2.8.3) Or this one: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4d27dc041c9164d6f3ad39e192f4b7d116ca3b3 (first released in 2.8.2) Either way, seems like a bug to me. If you explicitly specify a COST property value, especially a negative one to induce last run status, then it should be honored over either historical average measurement or failed last time, so run it first this time behavior. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com
Re: [CMake] test property COST not working in cmake 2.8.3?
On Fri, Nov 26, 2010 at 10:38:44AM -0500, Zach Mullen wrote: I just realized why this isn't working -- it's actually not a regression. Maybe we have different definitions of regression. I see a feature that used to do one thing but which now does something else. Here is what the docs say about the COST property: # COST: Set this to a floating point value. Tests in a test set will be # run in descending order of cost. This property describes the cost of a test. You can explicitly set this value; tests with higher COST values will run first. I don't see anything there about parallel or non-parallel runs. It seems to me that if I set the COST property, I should be able to control the order in which tests run, period. So at the very least, the docs should be updated if you intend to change the behavior. In this release we decided that the costs should only be taken into account in a parallel case (ctest -j N). Many users have implicit dependencies based on the order of their add_test calls, so we didn't want to break backward compatibility for those not using parallel ctest. It looks like ctest -j2 is respecting COST. Currently I have several tests that cannot run at the same time as others (they touch the same resources and/or running two of them at once would crush the machine). If I could get the old COST behavior by running ctest -j1, that might be an acceptable workaround, but it does not appear to work today. The non-parallel way to specify a test to run last is simply to make it the last add_test call. My CMake projects are modular (I imagine this is true for many CMake users). Each module is responsible for adding its own unit tests and code quality checks. As I said in my initial email, the code quality checks must run after the unit tests so that accurate code coverage values can be calculated. I can try to insure that my add_unittest() functions all run before my add_code_quality() functions, but that seems brittle and error-prone. It was much nicer when I could just tell add_code_quality() to add all its tests with COST -1000 to guarantee they run after everything else. I can imagine ways to work around this problem, but they all seem rather clunky, especially when COST used to solve the problem so simply and elegantly. I hope we can reach a useful middle ground about the future of the COST property. In its current state, it is of no use to me. Thanks, tyler On Fri, Nov 26, 2010 at 10:20 AM, Zach Mullen zach.mul...@kitware.comwrote: On Tue, Nov 23, 2010 at 6:02 PM, David Cole david.c...@kitware.comwrote: It might be due to this commit: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=142edf8ad4baccd991a6a8a3e5283d0b575acca2 (first released in 2.8.3) Or this one: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4d27dc041c9164d6f3ad39e192f4b7d116ca3b3 (first released in 2.8.2) Either way, seems like a bug to me. If you explicitly specify a COST property value, especially a negative one to induce last run status, then it should be honored over either historical average measurement or failed last time, so run it first this time behavior. ___ 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] set CMAKE_INSTALL_PREFIX in CMakeLists
On Thu, Nov 25, 2010 at 02:01:31PM +0100, Marcel Loose wrote: On 24-11-2010 at 17:45, in message 20101124164507.gg23...@cryptio.net, Tyler Roscoe ty...@cryptio.net wrote: On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote: SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install prefix) So, without the test to CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT, and without the FORCE option. No, as I mentioned, there was an article of one the CMake-maintainers who recommended this. Micha is correct. CMAKE_INSTALL_PREFIX is set before your CMakeLists.txt is processed, so the above will never do anything. tyler Well, I tested this before I posted my reply. It does work the way I describe it. Try it yourself. It doesn't work for me: [tyle...@tpb006:~/cmake-test-install-prefix]$ cmake --version cmake version 2.8.3 [tyle...@tpb006:~/cmake-test-install-prefix]$ cat CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(p) set (CMAKE_INSTALL_PREFIX foo CACHE PATH docstring) message (CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}) [tyle...@tpb006:~/cmake-test-install-prefix]$ mkdir b cd b cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done CMAKE_INSTALL_PREFIX = /usr/local -- Configuring done -- Generating done -- Build files have been written to: /tpb006/tylermr/cmake-test-install-prefix/b ___ 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] test property COST not working in cmake 2.8.3?
On Tue, Nov 30, 2010 at 01:29:37PM -0500, Zach Mullen wrote: Hm, yours was a use case we didn't really consider when we were making changes to cost behavior. Clearly. :) The middle ground here would be to respect costs in the non-parallel case when they are expressed explicitly This sounds good. but not to cost-order them automatically based on their previous run times. I don't care too much about this behavior, but it seems like a nice feature. Perhaps if CTest reserved a range for its own COST data (-10 = CTest-calculated COST = 10?) then users could use costs -10 or 10 to insure ordering of certain tests? So what are the next steps? Should I open a bug to track this issue? Is this an easy change (so easy a monkey like me can do it) or can someone at Kitware take care of it? I am able and eager to test a CMake nightly build that fixes this bug/regression/misunderstanding. Thanks, tyler On Tue, Nov 30, 2010 at 12:43 PM, Tyler Roscoe ty...@cryptio.net wrote: On Fri, Nov 26, 2010 at 10:38:44AM -0500, Zach Mullen wrote: I just realized why this isn't working -- it's actually not a regression. Maybe we have different definitions of regression. I see a feature that used to do one thing but which now does something else. Here is what the docs say about the COST property: # COST: Set this to a floating point value. Tests in a test set will be # run in descending order of cost. This property describes the cost of a test. You can explicitly set this value; tests with higher COST values will run first. I don't see anything there about parallel or non-parallel runs. It seems to me that if I set the COST property, I should be able to control the order in which tests run, period. So at the very least, the docs should be updated if you intend to change the behavior. In this release we decided that the costs should only be taken into account in a parallel case (ctest -j N). Many users have implicit dependencies based on the order of their add_test calls, so we didn't want to break backward compatibility for those not using parallel ctest. It looks like ctest -j2 is respecting COST. Currently I have several tests that cannot run at the same time as others (they touch the same resources and/or running two of them at once would crush the machine). If I could get the old COST behavior by running ctest -j1, that might be an acceptable workaround, but it does not appear to work today. The non-parallel way to specify a test to run last is simply to make it the last add_test call. My CMake projects are modular (I imagine this is true for many CMake users). Each module is responsible for adding its own unit tests and code quality checks. As I said in my initial email, the code quality checks must run after the unit tests so that accurate code coverage values can be calculated. I can try to insure that my add_unittest() functions all run before my add_code_quality() functions, but that seems brittle and error-prone. It was much nicer when I could just tell add_code_quality() to add all its tests with COST -1000 to guarantee they run after everything else. I can imagine ways to work around this problem, but they all seem rather clunky, especially when COST used to solve the problem so simply and elegantly. I hope we can reach a useful middle ground about the future of the COST property. In its current state, it is of no use to me. Thanks, tyler On Fri, Nov 26, 2010 at 10:20 AM, Zach Mullen zach.mul...@kitware.com wrote: On Tue, Nov 23, 2010 at 6:02 PM, David Cole david.c...@kitware.com wrote: It might be due to this commit: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=142edf8ad4baccd991a6a8a3e5283d0b575acca2 (first released in 2.8.3) Or this one: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4d27dc041c9164d6f3ad39e192f4b7d116ca3b3 (first released in 2.8.2) Either way, seems like a bug to me. If you explicitly specify a COST property value, especially a negative one to induce last run status, then it should be honored over either historical average measurement or failed last time, so run it first this time behavior. ___ 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] set CMAKE_INSTALL_PREFIX in CMakeLists
On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote: SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install prefix) So, without the test to CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT, and without the FORCE option. No, as I mentioned, there was an article of one the CMake-maintainers who recommended this. Micha is correct. CMAKE_INSTALL_PREFIX is set before your CMakeLists.txt is processed, so the above will never do anything. tyler ___ 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] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 11:41:46AM -0500, David Cole wrote: On Wed, Nov 24, 2010 at 11:34 AM, Rolf Eike Beer e...@sf-mail.de wrote: So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Adding that information in the documentation would be good, I agree. (Although quite time consuming and costly for somebody...) Perhaps a good compromise is simply to add version information to all new CMake commands/variables/properties that are added henceforth? Thanks, tyler ___ 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] test property COST not working in cmake 2.8.3?
I use set_tests_properties (... COST -500) to force my code coverage checks to run after all the unit tests have run. This has stopped working and I'm reasonably confident that the only thing that changed was an upgrade from cmake 2.8.0 or 2.8.1 to 2.8.3. I couldn't find anything in the bug tracker or in the release notes suggesting that COST or test properties were changed in 2.8.3. I'm still getting lines like this in my generated CTestTestfile.cmake: SET_TESTS_PROPERTIES(rs_exerciser_2dgrid PROPERTIES COST -500 FAIL_REGULAR_EXPRESSION TP_EXERCISER_FAIL) and the FAIL_REGULAR_EXPRESSION property seems to be working just fine. I've included a small repro case below. This looks like a regression. Should I open a bug? Thanks, tyler [tyle...@tpb006:~/cmake-test-properties-test]$ cat CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(p) enable_testing() add_test (i_should_run_second echo i should run second) set_tests_properties (i_should_run_second PROPERTIES COST -1) add_test (i_should_run_first echo i should run first) [tyle...@tpb006:~/cmake-test-properties-test]$ mkdir b cd b cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /tpb006/tylermr/cmake-test-properties-test/b [tyle...@tpb006:~/cmake-test-properties-test/b]$ ctest --version ctest version 2.8.3 [tyle...@tpb006:~/cmake-test-properties-test/b]$ ctest Test project /tpb006/tylermr/cmake-test-properties-test/b Start 1: i_should_run_second 1/2 Test #1: i_should_run_second .. Passed0.01 sec Start 2: i_should_run_first 2/2 Test #2: i_should_run_first ... Passed0.01 sec 100% tests passed, 0 tests failed out of 2 Total Test time (real) = 0.04 sec [tyle...@tpb006:~/cmake-test-properties-test/b]$ /usr/local/cmake-2.8.1-Linux-i386/bin/ctest --version ctest version 2.8.1 [tyle...@tpb006:~/cmake-test-properties-test/b]$ /usr/local/cmake-2.8.1-Linux-i386/bin/ctest Test project /tpb006/tylermr/cmake-test-properties-test/b Start 2: i_should_run_first 1/2 Test #2: i_should_run_first ... Passed0.01 sec Start 1: i_should_run_second 2/2 Test #1: i_should_run_second .. Passed0.01 sec 100% tests passed, 0 tests failed out of 2 Total Test time (real) = 0.02 sec ___ 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] Trouble with install()
On Thu, Nov 18, 2010 at 10:55:15PM -0500, Braden Walters wrote: #Install headers set(HEADERS test.hpp) foreach(HEADER ${HEADERS}) install(TARGETS ${CMAKE_CURRENT_SOURCE_DIR}/include/${HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/PROJECT/${HEADER}) endforeach() Try install(FILES ...) instead. TARGETS is for installing CMake targets. tyler ___ 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] BundleUtilities
On Tue, Nov 16, 2010 at 10:15:28PM -0500, David Doria wrote: Is the goal simply to copy ...VTK/bin/libvtkHybrid.a into the package? I tried this: INSTALL(CODE \${VTK_DIR}/bin/libvtkHybrid.a) More like: INSTALL(FILES ${VTK_DIR}/bin/libvtkHybrid.a) tyler ___ 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 for cygwin
On Thu, Oct 28, 2010 at 12:49:16PM -0500, Yaakov (Cygwin/X) wrote: We see the defining of WIN32 on Cygwin as a *bug*, not a feature, and it needs to be fixed outright. I think the crux of the dilemma is this: what do you say to the people who rely on this buggy behavior for their packages to build correctly? tyler ___ 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] CTest: use 'make -k' instead of 'make -i'
On Mon, Oct 25, 2010 at 04:54:41PM +0200, Michael Wild wrote: On 25. Oct, 2010, at 16:45 , Marcel Loose wrote: Wouldn't it make more sense to use 'make -k' instead? Some weeks ago I also wanted to propose this, but then realized one important drawback of -k: Say, you have target B depending on A. If A fails, nothing from B will be compiled, thus hiding programming errors that will only show up once A is fixed. What needs to be fixed is the error parser in CTest. Marcel, I think you can override this compiler flag with use of CTestCustom.cmake or one of those override mechanisms. Michael and everyone, I think that use case is pretty narrow. If I know that B depends on A and I see that A failed, I'm going to take a pretty suspicious view of any build errors in B -- what if they were somehow caused by the failure in A? Besides, doesn't -k satisfy your use case while removing the confusing and erroneous report of success caused by using -i? Thanks, tyler ___ 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] How to tell if a target is already defined?
On Tue, Oct 19, 2010 at 12:05:21PM -0700, J Decker wrote: WIthout adding a bunch of custom addtions, is there something I can test to see if a target is already defined? Did you try 'if (TARGET ...)'? tyler ___ 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] altering RUN_TESTS post-build command (MSVC + CTest)
On Mon, Sep 20, 2010 at 09:07:34AM -0700, Keith Gunderson wrote: I'm using a MSVC 9.0 Generator with Cmake 2.8.2 How do I add a change so that the command for my RUN_TESTS project changes from the default of: C:\Program Files\CMake 2.8\bin\ctest.exe --force-new-ctest-process -C $(OutDir) if errorlevel 1 goto VCReportError to C:\Program Files\CMake 2.8\bin\ctest.exe --force-new-ctest-process -VV -C $(OutDir) if errorlevel 1 goto VCReportError AFAIK, there is no way to do this without patching CMake. What we do instead is just create our own equivalent of the RUN_TESTS target: set (cmd ${CMAKE_CTEST_COMMAND} -VV) if (MSVC) set (cmd ${cmd} -C ${CMAKE_CFG_INTDIR}) else () set (cmd ${cmd} -C ${CMAKE_BUILD_TYPE}) endif () add_custom_target (my_run_tests COMMAND ${cmd} ) hth, tyler ___ 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] add_test : expand environment variable at running time
On Mon, Sep 13, 2010 at 06:01:52PM +0200, Olivier Pierard wrote: - add_test( mpirun -machinefile $TMPDIR myexec ) = will never expand TMPDIR - I don't understand why because in CTestTestfile.cmake, I have add_test( test_name mpirun -machinefile $TMPDIR myexec); if I submit this as a bash command, environment variable is well expanded; Does ctest prevent expanding variables at running time ? - add_test( mpirun -machinefile ${TMPDIR} myexec ) = expands at configuration time with cmake (empty because not defined in cmake - logical) - add_test( mpirun -machinefile $ENV{TMPDIR} myexec ) = expands at configuration time with cmake but TMPDIR is not yet defined on the master node (logical) How about add_test (... \$TMPDIR ... ) ? tyler ___ 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] How to invoke 64 bit cmd.exe from cmake script on Windows 7 (x64).
On Sun, Aug 22, 2010 at 07:36:21PM +0100, Alexander Tarnopolsky wrote: I'm trying to invoke an interactive shell from a cmake script using the following: execute_process (COMMAND ${SHELL} ${ARGS}) And the 32bit cmd.exe is invoked on Windows 7 x64 (since the cmake itself runs in 32bit environment). But I'm interested in 64bit cmd.exe. Is there a way to invoke it from cmake? Where is ${SHELL} defined? What is its value? I suspect you could use find_program() with appropriate arguments to specify that you want the 64-bit cmd.exe. tyler ___ 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] Build logging
On Wed, Aug 18, 2010 at 11:53:14AM +0200, Johny wrote: I am using a Ctest script to do a continuous build, however I can't seem to find a way to log the output of my make system since when you give ctest_build(BUILD src) it is automatically logged to the build.xml in the Testing directory. Is there anyway i can log the output of the makefile that gets generated to another file ? maybe by modifying something in the CMakeLists ?? I would like this as well, but I don't think CTest will provide it. What we do is run something like ctest -S script.cmake -VV build.log 21. tyler ___ 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] ctest: Empty reply from server
On Tue, Aug 17, 2010 at 03:35:02PM +0200, Lorenzo Natale wrote: Submit files (using http) Using HTTP submit method Drop site:[..] Error when uploading file: [...]/20100816-2200/Build.xml Error message was: Empty reply from server I agree that CDash doesn't always produce the most helpful error messages (submit to a dashboard that's not there and nothing in the chain complains! your build just never arrives anywhere). However, there's not a lot of detail here. Does your Build.xml look correct? Are there any relevant messages in the web server logs? tyler ___ 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] Weird ctest behaviour
On Tue, Aug 17, 2010 at 05:14:07PM +0200, Johny wrote: I have a ctest script which i am using as a test in my build like this add_test ( ctest -S script.cmake) however once the script finishes executing i get a CMake error saying my CTEST_SOURCE_DIRECTORY, CTEST_BINARY_DIRECTORY and CTEST_COMMAND are not ctest -S scripts are mostly intended (afaik) for running dashboard scripts where those variables are required. How about using cmake -P script.cmake instead? tyler ___ 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] Build tree with common dependency - CMP-0002
On Thu, Aug 05, 2010 at 09:26:05PM -0500, Frank Gruman wrote: The problem - dependencies. Each build is supposed to be independent of any other. S: Build Project A-1 Depends on B-1 Depends on C-3 Build Project A-2 Depends on B-3 Depends on C-3 Build Project A-3 Depends on A-1 Depends on A-2 I cannot figure out how to prevent CMP-0002 errors on target C-3 when trying to build A-3 (without first having to run a separate build of C-3 prior to running any of them). Here is a snippet of how I am loading the C-3 library in B-1 and B-3: find_library(PLATFORM_LIB Platform ${CMAKE_BINARY_DIR}/../lib/$ENV{PLATFORM_NAME} ) if (NOT EXISTS ${PLATFORM_LIB}) message(STATUS Platform library does not exist. Adding source build.) add_subdirectory( ${CMAKE_BINARY_DIR}/../source/n2ksdk/platform ${CMAKE_BINARY_DIR}/../buildPlatform ) endif (NOT EXISTS ${PLATFORM_LIB}) You're checking if your library exists as a file on disk. At CMake time, this will rarely be true, as you haven't built that library yet. Instead, you should check for the existence of the CMake target that will cause the library to be built at compile time. You can do this with if (TARGET targetname). tyler ___ 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] How to exclude empty dirs from install
On Thu, Jul 22, 2010 at 04:57:50PM +0200, Olaf van der Spek wrote: Why aren't empty dirs excluded by default? Because if they were excluded, we would have someone on the list next month asking why she can't create empty directories with install() commands. tyler ___ 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] different test cases
On Thu, Jul 15, 2010 at 03:39:20PM -0500, Jörg F. Unger wrote: I'm using cmake to add a test environment to our project (with ctest). Is there a possibility to generate to groups of test with different tags in the makefile, so that after the generation of the makefiles the user might say make test or make extensiveTest? CTest has a ton of flags for controlling which tests to run. We use -R a lot. If you can come up with a nice way to run your test set (e.g. can you put the string extensive in any test you want to run as part of the extensiveTest set?), you could train your developers how to use CTest directly. You could also add a custom_target that runs something like ${CMAKE_CTEST_COMMAND} -R extensive, which gives you the build target you're looking for. tyler ___ 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] Copy two files into one file
On Fri, Jul 09, 2010 at 06:39:57PM +0200, Bo Thorsen wrote: Does this also work with binary files? From the documentation on FILE, this isn't really clear to me. Why don't you try it and let us know? tyler ___ 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] Building a Version Header
On Wed, Jul 07, 2010 at 10:43:15PM -0400, John Drescher wrote: On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel cg.wowus...@gmail.com wrote: I would like to generate file that looks something like this: // version.h #define VERSION v0.1-345-ga77ede8 You want to do that with configure_file The upside of this approach is that it's simple. The downside is that it is only run (and thus your version header is only updated) whenever CMake runs. It's possible for the source code to change without triggering a re-run of CMake. Consequently, we use a custom command to call a python script at build time. The script writes out the header with the up-to-date version info. tyler ___ 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] Different configurations with Visual Studio
On Mon, Jul 05, 2010 at 01:31:41PM +0200, Mark Van Peteghem wrote: I see, thanks. I intend to write a Python script that adds the extra platform solution, because we really need that. Visual Studio and Code::Blocks project files are XML files, so it shouldn't be too hard. If possible, I would be interested in seeing/using this script. Thanksm, tyler ___ 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] Different configurations with Visual Studio
On Mon, Jul 05, 2010 at 10:47:32AM -0400, John Drescher wrote: What is wrong with different build folders for each compiler / ide? I'm interested in an answer to this question as well. For me, the biggest thing is that it's what VS developers are accustomed to. I've been educating it out of them, but if both win32 and win64 configurations could be made available through a robust configure-time process, that might be better. Thanks, tyler ___ 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] Howto unset cache variable without UNSET()
Marcel, Maybe I missed it earlier ITT, but I don't understand why you can't just use if(FOO) instead? tyler On Thu, Jul 01, 2010 at 11:53:33AM +0200, Marcel Loose wrote: Hi Fraser, It doesn't. Well, partly it does, but unfortunately setting FOO to an empty string doesn't make it undefined; i.e. if(DEFINED FOO) will be TRUE. I've decided to use 'if(${FOO} MATCHES ^$)' instead. Best regards, Marcel Loose. On Wed, 2010-06-30 at 10:57 +0100, Fraser Hutchison wrote: I think 'set(FOO CACHE INTERNAL Foo)' should do the trick. All the best, Fraser. On 30/06/2010 9:38 AM, Marcel Loose wrote: Hi all, Is there a way to unset a cache variable, i.e. make it undefined, *without* using unset(). My reason for asking is that my CMake scripts need to be backward compatible with every 2.6 version. Unfortunately, unset() was added in a patch release (2.6.3 if I recall correctly), so I cannot use it. The problem is that, though 'set(FOO)' will make FOO undefined, this doesn't seem to work for 'set(FOO CACHE INTERNAL Foo)'. Any ideas how to accomplish this? Best regards, Marcel Loose. ___ 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] Generating a combined x86 and x64 Visual Studio project
On Thu, Jul 01, 2010 at 02:18:45PM -0500, Adarr, Lee wrote: After generating a Visual Studio 9 2008 Win64 solution, the solution contains only the x64 build specification. Is it possible to have CMake Yes, this is as designed. add the win32 build specification to the same solution or must one generate separate 32-bit and 64-bit solutions/projects in different directories? This is not currently possible. Here's a thread where this was discussed previously: http://www.cmake.org/pipermail/cmake/2009-June/029897.html tyler ___ 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] Ways of setting CTEST_BUILD_NAME
On Thu, Jun 24, 2010 at 03:07:50PM -0400, Convey, Christian J CIV NUWC NWPT wrote: Suppose I want do just use ctest in a dead-simple manner: add a few lines to my CMakeLists.txt files, then run cmake . make test. In this scheme, what's the easiest way I can set CTEST_BUILD_NAME? Simply setting that variable in my CMakeLists.txt file doesn't *seem* to be effective. Based on my build system, it looks like you can just set BUILDNAME before you do include(CTest). You may need an enable_testing() call as well. tyler ___ 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] ADD_CUSTOM_COMMAND split on multiple lines
On Wed, Jun 23, 2010 at 03:58:59PM +0200, Aeschbacher, Fabrice wrote: Is there any way to split a custom command on multiple lines (for readability), e.g: ADD_CUSTOM_COMMAND( OUTPUT .patched COMMAND for patch in ${ARGV}; do\ echo applying $patch; \ patch -p1 $patch \ done COMMAND touch .patched VERBATIM ) Should be possible. I don't think you want to escape your newlines, but you might need to quote the entire COMMAND string. If not, is there any way to run a (cmake) function/macro, e.g: MACRO(mymacro) ... ENDMACRO() ADD_CUSTOM_COMMAND( OUTPUT .patched COMMAND mymacro() COMMAND touch .patched VERBATIM ) This doesn't make sense because mymacro is available at configure time but your custom command will run at build time. One way to do what you want is to put the definition and call of mymacro() in a script, then run that script at build time with COMMAND ${CMAKE_COMMAND} -P mymacro.cmake. tyler ___ 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] Changing compiler flags generated by cmake
On Tue, Jun 22, 2010 at 08:30:43PM -0700, ben scott wrote: I know about the variable to add custom flags for g++, but how do I get rid if unwanted flags? I am writing a program for KDE on Linux and cmake insists on Something like: string(REPLACE -ansi CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ___ 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] change where package is generated; full name of package with extension
1. I want to change where make package deposits the packages it creates. Is there a way to do this -- some cpack variable I haven't found? 2. I want to get a hold of the name (or names) of generated packages. I know the package will be called myproject.some_extension, but how do I calculate some_extension? Is there some mapping between package type (TGZ, ZIP, NSIS) and the extension it ends up with (.tar.gz, .zip, .exe)? Thanks, tyler ___ 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] change where package is generated; full name of package with extension
On Fri, Jun 18, 2010 at 06:30:25PM +0200, Eric Noulard wrote: 2010/6/18 Tyler Roscoe ty...@cryptio.net: 1. I want to change where make package deposits the packages it creates. Is there a way to do this -- some cpack variable I haven't found? No variable I am aware of. However you may create a custom target which call make package and then move the file, provided you know the name of the generated file The frustrating part here is that I can't add_dependencies or post-build custom_commands to the PACKAGE target because it is a magic CMake target. I suppose I can look into writing a custom_command that runs cpack with appropriate arguments, but I hoped to avoid this step. but how do I calculate some_extension? Is there some mapping between package type (TGZ, ZIP, NSIS) and the extension it ends up with (.tar.gz, .zip, .exe)? Concerning the extension, it is fixed in the C++ code of the generator in the GetOutputExtension method: Yeah, I was afraid of this. Looks like I'll need to maintain my own mapping of cpack generator types - extensions on disk. Thanks for your help, Eric. tyler ___ 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] Variable Propagation
On Mon, Jun 14, 2010 at 01:40:38PM +0200, Aeschbacher, Fabrice wrote: I need to provide easy adding for source files to the developers, So it would be nice to just have a CMakelists.txt in every subfolder, which then edits the source-variable. Also consider to use properties for such a purpose. Which property do you actually think about? You can set arbitrary properties (MY_MAGIC_PROPERTY) and query them later. I think this is what Michael meant. tyler ___ 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] Nesting a cmake project
On Mon, Jun 07, 2010 at 11:54:12AM -0400, Nathan Huesken wrote: I have a cmake project into which I want to nest another cmake project. The nested cmake project is a complete project working on its own, and the outer cmake project depends on it. So when the outer cmake project is build, the inner one should be build first. The inner, as well as the outer cmake project have several targets, such as - doc - test ... I don't have any experience with external projects so I can't help you there, but two suggestsions/ideas: 1. Why do you need to nest one project inside the other? I think you will have less trouble if you treat each one as its own independent project. 2. Use add_subdirectory() instead of add_external_project() to hook these two projects together. tyler ___ 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] Different configurations for Debug and Release
On Mon, Jun 07, 2010 at 02:43:35PM -0300, Felipe Sodré Silva wrote: I need to write a CMakeLists file to generate a VS 2005 project in which I can have different project settings for Debug and Release configurations. For example, I need to have a set_target_properties directive for Release builds, but not for Debug builds. Is it possible to write such a CMakeLists that does this? Depends on what property/variable you're trying to set. Many of the interesting ones (e.g. CXX_FLAGS) have configuration-specific variants (e.g. CXX_FLAGS_RELEASE, CXX_FLAGS_RELEASE). tyler ___ 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 2.8.1 / Win: Neither if nor else?`
On Fri, May 21, 2010 at 02:04:38PM -0700, Torsten Rohlfing wrote: FIND_PACKAGE(ZLIB) IF(ZLIB_FOUND) MESSAGE( WARNING HAVE system zlib ) ELSEIF(ZLIB_FOUND) MESSAGE( WARNING NO system zlib ) ENDIF(ZLIB_FOUND) I don't see an else clause here, just two ifs (that check the same condition). tyler ___ 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] ctest, make test and build config
On Tue, May 18, 2010 at 05:37:32PM +1000, ross hennessy wrote: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}, which as I'm on windows (I don't think this gets set on linux?), evaluates to either ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug or ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release. So I would like my test to have this information, and how I've tried doing this so far is to supply a parameter to the test eg. ADD_TEST( MyTest MyTest -p \${CMAKE_BUILD_TYPE} ) CMAKE_BUILD_TYPE isn't defined on Windows even at CMake time. Just pass ${CMAKE_CFG_INTDIR} to your add_test and you should be good to go. tyler ___ 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] Binaries not ending up in the RUNTIME_OUTPUT_DIRECTORY
You probably need the Prefix Hack: http://www.itk.org/Bug/view.php?id=8243 tyler On Mon, May 17, 2010 at 09:53:34AM -0500, aaron.mead...@thomsonreuters.com wrote: Hi All! I'm trying to migrate an existing Visual Studio 8 2005 source tree to CMake. The only problem I'm having right now is getting the build artifacts to end up in the directories I want them in. I would like everything to show up in the ${PROJECT_BINARY_DIR}/bin dir, but only static libraries are showing up there. In particular, I have noticed this as I've been adding post build steps to call my unit tests. I'll include my root CMakeLists.txt and the UnitTest CMakeLists.txt. If anyone can spot the issue, I'd be grateful! (Any other suggestions welcome as well!) ( Note, the MESSAGE() calls show that the two variables are defined correctly in both CMakeLists.txt files. ) Root CMakeLists.txt (./CmakeLists.txt) cmake_minimum_required (VERSION 2.6) set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/c_flag_overrides.cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cxx_flag_overrides.cmake) project (VersionInfo CXX) # Default Include Dir include_directories(${PROJECT_SOURCE_DIR}) include_directories($ENV{RDFD3RDPARTYDIR}/include) link_directories($ENV{RDFD3RDPARTYDIR}/lib) if(DEBUG) link_directories($ENV{RDFD3RDPARTYDIR}/lib/Debug) else() link_directories($ENV{RDFD3RDPARTYDIR}/lib/Release) endif() # New style of output location... doesn't seem to be supported in my version of CMake SET( RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin ) SET( LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin ) SET( ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin ) # Old style of output location... still works SET( RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) SET( ARCHIVE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) LINK_DIRECTORIES( ${LIBRARY_OUTPUT_DIRECTORY}) ENABLE_TESTING() MESSAGE(Master: Runtime_output_path: ${RUNTIME_OUTPUT_PATH} ) MESSAGE(Master: Runtime_output_directory: ${RUNTIME_OUTPUT_DIRECTORY} ) add_definitions(-D_SCL_SECURE_NO_WARNINGS) # Library projects add_subdirectory(Toolbox) add_subdirectory(VersionSystem) # Executables add_subdirectory(VersionCompiler) add_subdirectory(ReadVer) # Test Projects add_subdirectory(TestLib1) add_subdirectory(TestLib2) add_subdirectory(TestDLL) add_subdirectory(TestEXE) UnitTest CMakeLists.txt (./VersionSystem/UnitTests/CMakeLists.txt) FILE( GLOB interfacefiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h *.hpp ) FILE( GLOB srcfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h *.hpp *.cpp *.c ) SOURCE_GROUP( Interface FILES ${interfacefiles} ) SOURCE_GROUP( Source FILES ${srcfiles} ) ADD_EXECUTABLE( VersionSystem-UT ${srcfiles} ) TARGET_LINK_LIBRARIES( VersionSystem-UT VersionSystem ) MESSAGE(VersionSystem-UT: Runtime_output_path: ${RUNTIME_OUTPUT_PATH} ) MESSAGE(VersionSystem-UT: Runtime_output_directory: ${RUNTIME_OUTPUT_DIRECTORY} ) ADD_CUSTOM_COMMAND(TARGET VersionSystem-UT POST_BUILD COMMAND VersionSystem-UT.exe WORKING_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY} ) #ADD_TEST( VersionSystem VersionSystem-UT ) Directory Structure and CMakeLists.txt locations: ./CMakeLists.txt ./ReadVer/CMakeLists.txt ./ReadVer/UnitTests/CMakeLists.txt ./TestDLL/CMakeLists.txt ./TestDLL/UnitTests/CMakeLists.txt ./TestEXE/CMakeLists.txt ./TestEXE/UnitTests/CMakeLists.txt ./TestLib1/CMakeLists.txt ./TestLib1/UnitTests/CMakeLists.txt ./TestLib2/CMakeLists.txt ./TestLib2/UnitTests/CMakeLists.txt ./Toolbox/CMakeLists.txt ./Toolbox/UnitTests/CMakeLists.txt ./VersionCompiler/CMakeLists.txt ./VersionCompiler/UnitTests/CMakeLists.txt ./VersionSystem/CMakeLists.txt ./VersionSystem/UnitTests/CMakeLists.txt Aaron Meadows Software Engineer Thomson Reuters Phone: 314.468.3530 Mobile: 636.541.6139 aaron.mead...@thomsonreuters.com thomsonreuters.com This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. ___ 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
Re: [CMake] How does CPACK decide what goes into release packages?
On Mon, May 17, 2010 at 12:53:34PM -0500, kent williams wrote: Internally, CPack will use CMake's install mechanism to automatically populate the package. Right. Mostly, all that CPack does is call make install on your project with a special CMAKE_INSTALL_PREFIX. but when I add include(CPack) and then run make package It generates empty install packages. The only target (for now) that needs to go into the package is a single statically linked executable, which is referenced with a cmake install command: INSTALL(TARGETS BRAINSFit DESTINATION bin) What does your project do when you make install? tyler ___ 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] distribute third party libs with NSIS
On Mon, May 17, 2010 at 02:41:21PM -0400, Michaël Presseau wrote: Hi, I have an application and I need to create an installer. I use CPack with NSIS. For now, I'm using : find_package(Boost COMPONENTS thread date_time filesystem REQUIRED) This give me le .lib associate to the dll file. This is compiling and working on computer with Boost already install. My problems occurs when I need to install the application on computer that doesn't have boost already install. What is the right way to do this. You probably want to look at BundleUtilities (and the fixup_bundle() function), which is designed to help solve the problem of getting all the 3rdparty libraries needed by your app. tyler ___ 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] How to install library in a sub-directory matching the active visual studio configuration?
On Sat, May 15, 2010 at 05:53:45PM +0200, Baptiste Lepilleur wrote: I initially tried using the variable ${CMAKE_BUILD_TYPE} but it seems to always expand to a blank string, and the doc imply that it does not work with Visual Studio solution as it has multiple configurations. So I switched Correct. to ${CMAKE_CFG_INTDIR}: install(TARGETS unrar_lib RUNTIME DESTINATION bin/${CMAKE_CFG_INTDIR} ARCHIVE DESTINATION lib/${CMAKE_CFG_INTDIR} LIBRARY DESTINATION lib/${CMAKE_CFG_INTDIR} ) But it installs the library in a directory named $(OutDir)... $(OutDir) is a VS macro so only VS knows how to interpret it. Since installation is done by CMake, you can't use CMAKE_CFG_INTDIR there. Alternatively, is it possible to delay variable expansion until the cmake_install.cmake script is invoked? I think what I use to solve this problem (can't check right now) is \${CMAKE_BUILD_TYPE}. This sticks ${CMAKE_BUILD_TYPE} into cmake_install.cmake, which is then correctly interpreted at install time. tyler ___ 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] depend on install target?
On Fri, May 14, 2010 at 01:41:22PM -0500, Kevin Burge wrote: I'd like to add a setup target that depends on install so I can just do make setup. Does anyone have a work around while we wait on http://public.kitware.com/Bug/view.php?id=8438? You could write a custom_target my_install that runs install by hand (cmake -P cmake_install.cmake). Then you can add_dependency on your custom target. I've considered doing this but never tried it. tyler ___ 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] Unit tests, but not CTest
Let's keep this on the list in case it helps someone else. On Fri, May 07, 2010 at 10:27:16PM +0100, Magnus Therning wrote: On 07/05/10 17:24, Tyler Roscoe wrote: On Fri, May 07, 2010 at 04:41:23PM +0100, Magnus Therning wrote: add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD # Call the runner script directly. By doing it this way, all the # unit tests in the executable run at once. If we call CTest # here (like we do for the _runtest target), the script (and # thus the python interpreter) is invoked once for each test in # the executable, which is slower than calling the script once. COMMAND ${PYTHON_EXECUTABLE} ${${PROJECT_NAME}_TESTRUNNER} ${CMAKE_CFG_INTDIR} --gtest_print_time ) One thing though, it seems the command is run *always* irrespective of whether the target is built or not. That doesn't seem to square up with the text in the man page: Works For Me. I only see unit test runs if the library in question is recompiled or relinked. What version of CMake are you using? 2.8 What kind of target is ${PROJECT_NAME}? I used a target created with add_custom_target, so maybe that's the cause of it. I think all the targets in our project which use this post-build step are libraries or executables. If your target is a custom_target that always runs (which, as noted in the docs, custom_targets sometimes do) then of course the post-build step will also always run. hth, tyler ___ 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] Unit tests, but not CTest
On Fri, May 07, 2010 at 04:41:23PM +0100, Magnus Therning wrote: add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD # Call the runner script directly. By doing it this way, all the # unit tests in the executable run at once. If we call CTest # here (like we do for the _runtest target), the script (and # thus the python interpreter) is invoked once for each test in # the executable, which is slower than calling the script once. COMMAND ${PYTHON_EXECUTABLE} ${${PROJECT_NAME}_TESTRUNNER} ${CMAKE_CFG_INTDIR} --gtest_print_time ) One thing though, it seems the command is run *always* irrespective of whether the target is built or not. That doesn't seem to square up with the text in the man page: Works For Me. I only see unit test runs if the library in question is recompiled or relinked. What version of CMake are you using? tyler ___ 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] python DeprecationWarning marked as error
I just posted this to the CDash mailing list. Julien pointed out that this is actually a CTest problem (since CTest writes the XML saying what warnings happened during the build) and suggested I repost over here. I have the following warning in my project build: /.../rs/sdk/trunk/internalheaders/minorrev/_build/util/svnutils.py:34: DeprecationWarning: os.popen4 is deprecated. Use the subprocess module. infile, lines = os.popen4(svn info --non-interactive %s % workingCopyPathOrRepositoryURL) This warning is marked as an error in CDash. Shall I open a bug? Is there a workaround to explain to CTest that this output is not an error? And yes, I'm aware that popen* sucks and that subprocess is a lot better, but I don't want to fight that battle today. Thanks, tyler ___ 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] Cannot find UpdateCommand or GITCommand configuration key.
On Fri, May 07, 2010 at 05:10:59PM -0400, Bill Lorensen wrote: I get the subject message. I have defined set( CTEST_GIT_COMMAND git ) SET(UPDATE_COMMAND ${GITCOMMAND}) SET(UPDATE_OPTIONS ${GIT_UPDATE_OPTIONS}) Did you try CTEST_UPDATE_COMMAND and CTEST_UPDATE_OPTIONS? Are you sure GITCOMMAND and GIT_UPDATE_OPTIONS are defined? tyler ___ 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] Why is this custom command run twice?
On Fri, Apr 30, 2010 at 12:03:12PM -0400, Brad King wrote: Unfortunately this can't be fixed upstream without breaking the legacy extension-finding feature. Isn't this what CMake policies are for? Or is the offending code buried in some dark corner where policies won't help? tyler ___ 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] Unit tests, but not CTest
On Tue, Apr 27, 2010 at 02:47:18PM +0100, Magnus Therning wrote: Except of course that it will take away one of the things I *really* want, which is that all unit tests are run every time I compile. We run our unit tests with a python wrapper script that does some environment configuration before running the test. We then add this script as a post_build custom command so that the unit test runs after it compiles. add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD # Call the runner script directly. By doing it this way, all the # unit tests in the executable run at once. If we call CTest # here (like we do for the _runtest target), the script (and # thus the python interpreter) is invoked once for each test in # the executable, which is slower than calling the script once. COMMAND ${PYTHON_EXECUTABLE} ${${PROJECT_NAME}_TESTRUNNER} ${CMAKE_CFG_INTDIR} --gtest_print_time ) hth, tyler ___ 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] Unit tests, but not CTest
On Fri, Apr 23, 2010 at 04:24:06PM +0100, Magnus Therning wrote: A project that I'm currently trying to convert over to CMake has several unit tests written as standalone executables. Are there any examples around for integrating the running of such tests as part of the build in CMake? add_test just takes a command line. You can put whatever you want in there and ctest will run it for you. http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_test tyler ___ 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] Correct syntax for CPACK_NSIS_CREATE_ICONS
On Tue, Apr 13, 2010 at 12:39:13PM +0200, Yegor Yefremov wrote: With this expression set(CPACK_NSIS_CREATE_ICONS CreateShortCut \$SMPROGRAMS\\$STARTMENU_FOLDER\\${PROJECT_NAME}.lnk \$INSTDIR\\${PROJECT_NAME}.exe) I can successfully create a package, but cmake/cpack shows a warning like this: CMake Warning (dev) at D:/NTool/build/CPackConfig.cmake:51 (SET): Syntax error in cmake code at D:/NTool/build/CPackConfig.cmake:51 when parsing string CreateShortCut $SMPROGRAMS\$STARTMENU_FOLDER\NTool.lnk $INSTDIR\NTool.exe Invalid escape sequence \N Isn't there an example in the cmake book about this where you have to have (four backslashes) to survive all the escaping that happens downstream? Anyway, to paraphrase a quote I see on slashdot all the time, backslashes are like violence: if they don't work, apply more. Does it work if you use $PPROJECT_NAME}.exe? tyler ___ 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] error using ctest_configure in a ctest script
On Mon, Apr 12, 2010 at 12:11:54PM -0400, Zou, Di (Cont, ARL/CISD) wrote: I have this line in my ctest script: ctest_configure(OPTIONS -C ~/NetDMF_CMake_Config) At the dashboard, this is the error I get: Build Name:build-linux-c++ Configure Command:/usr/cta/CSE/Release/cmake-2.8.0.5/bin/cmake -C ~/NetDMF_CMake_Config -GUnix Makefiles ~/NetDMF_KD Configure Return Value:1 Configure Output: loading initial cache file ~/NetDMF_CMake_Config CMake Error: Error processing file: ~/NetDMF_CMake_Config '~' meaning your home dir is evaluated by your shell. Most non-shell tools don't understand what it means. Try using an absolute path (/home/di.zou) or the $HOME environment variable ($ENV{HOME} in CTest land). tyler ___ 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] error using ctest_configure in a ctest script
On Mon, Apr 12, 2010 at 01:15:11PM -0400, Zou, Di (Cont, ARL/CISD) wrote: I replaced: ctest_configure(OPTIONS -C ~/NetDMF_CMake_Config) with: ctest_configure(OPTIONS -C $ENV{HOME}/NetDMF_CMake_Config) I get the same error: Configure Command:/usr/cta/CSE/Release/cmake-2.8.0.5/bin/cmake -C /home/dizou/NetDMF_CMake_Config -GUnix Makefiles /home/dizou/NetDMF_KD Configure Return Value:1 Configure Output: loading initial cache file /home/dizou/NetDMF_CMake_Config CMake Error: Error processing file: /home/dizou/NetDMF_CMake_Config The configure command does not work from the terminal window either. Is your cache file corrupt? How did you create it? Can you let CMake create a new clean cache for you to see if that gets you beyond this error? tyler ___ 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] CPack, TGZ and directory layout
On Fri, Apr 09, 2010 at 08:53:27PM +0200, Alexander Neundorf wrote: set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) Is this documented somewhere ? If not, can you please put it in the wiki (e.g. in This finally motivated me to create an account for the kitware wiki. Thanks Alex :). I added an entry to http://www.cmake.org/Wiki/CMake:CPackConfiguration. Please feel free to improve it; my wording feels clumsy but I wanted to get *something* in there. tyler ___ 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] CPack, TGZ and directory layout
On Fri, Apr 02, 2010 at 09:50:59PM +0200, Allan W. Nielsen wrote: The result of this the the following file: TEST-0.1.1-Linux/bin/test What I would like to achieve is that the directory layout of the generated tar file is: /bin/test or maby bin/test Look at: set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) tyler ___ 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 has moved to Git!
On Fri, Mar 26, 2010 at 05:20:21PM -0500, Richard Wackerbarth wrote: Now that the setup scripting is more complex, I'm trying to use your cmake_common.cmake script for my CMake submissions. Tracking changes to that script would be much easier for me if you have it published in a publicly readable git repository. Might be nice if there were an easier way but FYI Kitware publishes their CTest driver script with each build. For example, from the CMake dashboard: http://public.kitware.com/dashboard.php?name=cmake Here's the CTest driver script uploaded with the build for krondor.kitware from last night: http://www.cdash.org/CDash/viewNotes.php?buildid=573213 tyler ___ 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] Testing with CMake--issue of subdirs
On Tue, Mar 23, 2010 at 02:43:45PM +0530, Kiran Gopal Patil wrote: I do have the CMakeLists.txt for the main and sub1,2,3 are added in it which inturn add sub11,22,33 I want to do make test for full project at directory main. In addition to this I want to do make test for sub11,22,33 selectively like say make test sub11. Use ctest directly instead of make test. ctest has a bunch of flags (-R, -I, -E) that you can use to run subsets of the tests in your system. tyler ___ 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] Handling library dependencies and minimizing duplicated include_directories
On Mon, Mar 22, 2010 at 05:47:15PM -0700, aaron_wri...@selinc.com wrote: So... no easy answer for this? The only reason I bring this up is that I've looked at the cmake version of boost, and it requires a library of several cmake files full of macros and functions that help get their project organization to work with cmake. I've had to resort to the same kind of thing. ADD_LIBRARY just didn't cut it. I like that cmake allows me to get to the functionality I want, but it seems that it becomes a scripting language at that point, and cmake is certainly not a scripting language. Boost for example has numerous helper functions or macros for using named arguments with macros and functions. (They are all very cleaver and I totally use them in my project.) Another example is that my project has functions and macros for adding the dependencies between libraries, dependencies like include directories, link directories, and link libraries. Is there something on the horizon for CMake to address these issues? Or have they been addressed, but I've missed them? On a side note, I see questions for this kind of thing all the time on this mailing list. I never see a very good answer. Perhaps a wiki page or a blog could be made covering project organization. It could perhaps cut down on repeat questions. My take on this is that every build system is a little different. Weird organic organization builds up over time. Different groups have different requirements. Different compilers and platforms require slightly different approaches. As such, it's hard to write a one size fits all solution. So I think the only way CMake can succeed is by providing fundamental building blocks and letting build engineers put those pieces together into a whole that suits their needs. I *do* think of CMake as a scripting language, one that's tuned for modelling builds and perfomring common activities related to builds (manipulating files, calling external scripts). That said, I agree the Boost stuff is interesting and once it matures, I hope we can find a way to absorb those concepts into CMake proper. Kind of like how the Boost libraries are experimental additions to C++ that are (sloowly) migrating back into the C++ spec. I also agree that the wiki could be expanded with more examples of common practices. The archives for this mailing list are sprinkled with fantastic examples from some experienced developers but it's not always easy to find what you're looking for. tyler ___ 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] Question about Nightly Builds
On Tue, Mar 23, 2010 at 04:50:54PM -0300, Felipe Sodre dos Santos wrote: Last night my nightly build broke, and after making some changes in the code and submitting to SVN server, it works for the experimental build. However, when I try the Nightly one again, it breaks exactly the same way as last night, as if I hadn't submitted any fix. How could that be? The Nightly build updates your working copy to its state at ${CTEST_NIGHTLY_START_TIME}. tyler ___ 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] Fwd: Bug ? Or I'm doing something wrong ?
On Mon, Mar 22, 2010 at 11:51:51AM -0400, David Cole wrote: Never use rebuild all with a cmake generated *.sln file... Just use Build Solution... Interesting. David, can you elaborate? tyler ___ 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 Visual Studio 2005 and DLLs
On Sat, Mar 20, 2010 at 07:30:36PM +0100, Theodore Papadopoulo wrote: All the tests (in the test directory) that use the DLL in the src directory fail at runtime because they do not find the dll... I suspect this is because of a different directory. All the examples I have found use the same directory for the DLL and the examples. AFAIK there are ~3 ways to solve this: - Make the build system deposit your built unittest executable alongside the DLLs. - Set up install rules to put the unittest executable alongisde the DLLs before running the unit tests. - Use a wrapper script that adds the DLL directory to your PATH before running the unittest executable. tyler ___ 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] integrating with installshield
I have a lot of complaints about Installshield, but I'll spare you the whinging and just say that I need to generate Installshield setups at the end of our CMake build. I am considering some options and was wondering if anyone else has experience with this. Currently, our build process is driven by a python script. I'm working on replacing this python script with a CTest script that also communicates with CDash, which is why I'm revisiting the Installshield question. The python script calls the Installshield standalone builder executable with arguments for the Installshield project file (generated separately using the Installshield IDE) and the directory containing the results of the CMake build. OPTION 1: The easiest thing would be to have a custom command that calls the Installshield standalone builder and to use add_dependencies() so that when make package is run or the PACKAGE target is built in Visual Studio, Installshield is also run. Unfortunately, we can't add_dependencies to PACKAGE because PACKAGE is a magic target (see http://www.cmake.org/Bug/view.php?id=8438). I wonder if anyone has a good way to fake adding this dependency. For example, I think it was Marcel who posted a workaround using a custom command that runs cmake -P cmake_install.cmake instead of using the INSTALL target directly. Is there a similar workaround available for packaging? I don't see a cpack_package.cmake to invoke directly. OPTION 2: I can use add_test() to add a test that does the work of running Installshield. An advantage of this approach is that my driver script can verify that my build and all the unit tests have run successfully before generating the Installshield setup. OPTION 3: I could try to add an Installshield generator type to CPack. I suspect this is more work than I can/should take on right now, plus it wouldn't be as featureful as the other CPack generators, plus the Installshield folks might cry licensing foul!. But maybe if it's easier than I think this could be a good solution, and more useful to the community at large? Any experience with these or other approaches would be appreciated. Thanks! tyler ___ 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] CTEST_UPDATE_COMMAND vs sparse working copy (was Re: continuous integration with CMake)
Following up on this thread: http://public.kitware.com/pipermail/cmake/2010-February/035197.html It's not as elegant as I would like -- support for ctest_update(... APPEND ...) would be much cleaner, but I didn't have the bandwidth to take on that project at this time -- but I believe I have a hack to solve my problem. This hack violates one of my fundamental rules: Thou Shalt Not Parse XML With Regular Expressions, but I decided that a native CTest solution would be easier to work with than an external python script using a python XML module. I'm posting this here in case it's helpful to someone else. Improvements and bug fixes are also welcome of course :). This is just a snippet from our CTest script that is driving Continuous builds. Some stuff may be missing (because it's defined elsewhere). Let me know if there's anything inscrutable and I'll fill it in. Oh yeah, thanks again to Clinton for the hack where we read the TAG file and use that to figure out where CTest is writing its .xml files. Thanks, tyler [...] # Used by tp_update(). set (TP_CTEST_UPDATE_XML_FILE Update.xml) [...] # Start a new submission. ctest_start (${dashboard_model}) # Calculate TP_CTEST_XML_DIR (which changes whenver ctest_start() is called). file (READ ${CTEST_BINARY_DIRECTORY}/Testing/TAG tag_file) string (REGEX MATCH [^\n]* xml_dir ${tag_file}) set (TP_CTEST_XML_DIR ${CTEST_BINARY_DIRECTORY}/Testing/${xml_dir}) [...] # ctest_update() does not work well with sparse working copies (and doesn't # support APPEND) so we work around that by hacking together the XML files # ctest_update() generates for CDash. macro (tp_update) unset (final_update_xml_contents) set (count 0) # tmr: RACE CONDITION HERE!!! maybe try to compensate by storing latest # revision at time of first update. but with no way to pass this value # to the svn st/svn info commands issued by ctest, not sure if it would # help. # # A test to enforce a quiet period in the repo before starting a build # could also solve this problem. foreach (subproject ${TP_SUBPROJECTS}) ctest_update ( SOURCE ${CTEST_SOURCE_DIRECTORY}/${subproject}/${TP_BRANCH} RETURN_VALUE subproject_count ) message (Found ${subproject_count} changed files in subproject ${subproject}/${TP_BRANCH}) math (EXPR count ${subproject_count} + ${count}) if (subproject_count GREATER 0) # Because we run a separate ctest_update() in each subproject # directory, we have to prepend ${subproject}/${TP_BRANCH} to the paths # returned by Subversion. # # tmr: Need to do anything (get rid of trailing slash?) when the # Update.xml contains an empty Name/Name? file (READ ${TP_CTEST_XML_DIR}/${TP_CTEST_UPDATE_XML_FILE} update_xml_contents ) #message (% raw update_xml_contents: ${update_xml_contents}) # Quotes around input variable are required! Without them, CMake # gets confused about semicolons (like the one in the XML entity # 'quot;'), resulting in malformed XML which CDash silently # drops. string (REPLACE Name Name${subproject}/${TP_BRANCH}/ massaged_xml_contents ${update_xml_contents} ) string (REPLACE Directory Directory${subproject}/${TP_BRANCH}/ massaged_xml_contents ${massaged_xml_contents} ) string (REPLACE FullName FullName${subproject}/${TP_BRANCH}/ massaged_xml_contents ${massaged_xml_contents} ) #message (% massaged_xml_contents: ${massaged_xml_contents}) # If this is the first XML file we're processing, we want to # keep the preamble. if (NOT DEFINED final_update_xml_contents) # tmr: Add comment that this Update.xml has been manually # cobbled together by this script. #set (final_update_xml_contents !-- comment --) string (REGEX REPLACE Directory.* final_update_xml_contents ${massaged_xml_contents} ) #message (% final_update_xml_contents (should just contain preamble now): ${final_update_xml_contents}) endif () # Pull out the body and save it. string (REGEX REPLACE .*/UpdateType[\r\n]+ xml_body ${massaged_xml_contents} ) string (REGEX REPLACE EndDateTime.* xml_body ${xml_body} )
Re: [CMake] CTest script doesn't checkout the head revision
On Fri, Mar 19, 2010 at 10:08:39AM -0300, Felipe Sodre dos Santos wrote: SET (CTEST_UPDATE_COMMAND svn) SET (REPO_USERNAME nightly_builder) SET (REPO_PASSWORD nightly_builder_pass) SET (REPO https://myrepo/svn/myproject/trunk) SET (CTEST_CVS_CHECKOUT svn co ${REPO} --username ${REPO_USERNAME} --password ${REPO_PASSWORD} ${CTEST_SOURCE_DIRECTORY}) Have you tried CTEST_CHECKOUT_COMMAND instead of CTEST_CVS_CHECKOUT since you're not using CVS. And the batch file that calls this script is as follows: rmdir /S /Q \myproject ctest -S myproject.ctest That is, it erases the previous checkout before actually start a new one. However, sometimes it seems like the checkout isn't made right, since it doesn't check out the HEAD revision (I know that because when I see a broken build in the morning, I do a svn update in the build directory and it updates many files that weren't changed in the mean time). I'm not sure I understand your problem, but I've observed that if CTEST_CHECKOUT_COMMAND is defined it will always be run before CTEST_UPDATE_COMMAND. For me this leads to a spurious lack of updated files: the checkout command updates my working copy so when the update command runs, it doesn't find any new files. Could this be related? tyler ___ 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] bad redirect in wiki
This page: http://www.cmake.org/Wiki/CPack:Generator_Information redirects to a page called: VTK/Tutorials/PythonEnvironmentSetup which AFAICT has nothing at all to do with CPack generators. The topics are so different that I can't even guess what someone was trying to accomplish by enacting this redirect. Should I open a bug? tyler ___ 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] Linking external static libraries into dlls
On Thu, Mar 04, 2010 at 06:30:02PM +0100, Christoph Höger wrote: I am currently trying to link a DLL with the netcdf_c++ static library in the hope I will not have to redistribute netcdf itself. (I thought the DLL could contain the needed code itself). This should work. Be careful, though. I think symbols from the static lib will only show up in your DLL if code in your DLL uses those symbols -- that is, not all symbols from the static lib are automatically imported into your DLL. This is all IIRC. target_library_add({${myLib} ${netcdf_c++.lib}) This is not a CMake command and google has never heard of it. If this is a macro in your CMake system, we'll need to see its contents before we can comment on it. tyler ___ 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] Watcom Support
On Wed, Mar 03, 2010 at 09:55:39AM -0800, J Decker wrote: OKay these should work great, but have to be done on a per-target basis, rather than being built into the generator. How would the ...\share\cmake-2.8\Modules\Platform\Windows-wcl386.cmake get modified to set link_flags? I would write a macro that wraps add_library()/add_executable() and also calls the appropriate set_target_properties() command. tyler ___ 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] How to add file dependencies to a target?
On Thu, Mar 04, 2010 at 11:50:14AM -0800, aaron_wri...@selinc.com wrote: For example, this doesn't work: ADD_EXECUTABLE(foo ${foo_SOURCES} ${foo_HEADERS}) ADD_CUSTOM_COMMAND( OUTPUT ${PROJECT_BINARY_DIR}/bar.ini COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/bar.ini ${PROJECT_BINARY_DIR} DEPENDS ${PROJECT_SOURCE_DIR}/bar.ini COMMENT Localizing \bar.ini\) ADD_DEPENDENCIES(foo ${PROJECT_BINARY_DIR}/bar.ini) add_dependencies() is for adding dependencies on targets, not on files. I can also get it to work if I add another target like so: ADD_EXECUTABLE(foo ${foo_SOURCES} ${foo_HEADERS}) ADD_CUSTOM_COMMAND( OUTPUT ${PROJECT_BINARY_DIR}/bar.ini COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/bar.ini ${PROJECT_BINARY_DIR} DEPENDS ${PROJECT_SOURCE_DIR}/bar.ini COMMENT Localizing \bar.ini\) ADD_CUSTOM_TARGET(copy_bar.ini DEPENDS ${PROJECT_BINARY_DIR}/bar.ini) ADD_DEPENDENCIES(foo copy_bar.ini) AFIAK this is the right way to do what you want. So do I have to have this additional indirection with the extra target? I have way too many targets as is. Is there anyway to get the first approach to work? It's like I need to add a file to ${foo_SOURCES} or ${foo_HEADERS} that isn't compiled or that doesn't show up in the IDE. And can this be done after the ADD_EXECUTABLE call, or does it have to be before? You could try a PRE_BUILD custom_command instead. I think that will run every time instead of just when bar.ini has changed. If you are going to tweak foo_SOURCES, you will need to do it before you call add_executable(). tyler ___ 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] windows link error
On Thu, Mar 04, 2010 at 06:19:03PM -0500, Simmons, Aaron wrote: Thanks-- the cmake cache is where the trouble is: CMAKE_LINKER:FILEPATH=C:/strawberry/c/bin/ld.exe I'm not sure where the bug is (if there is one). Should re-running cmake recreate the cache? Why does the presence of strawberry perl confuse cmake? If CMake recreated the cache each time, it wouldn't be much of a cache now would it :)? Semi-educated guess: CMake was looking for things that looked like linkers in your PATH. For whatever reason (running CMake from an environment where that magic Visual Studio .bat file hadn't been sourced and thus your environment was incomplete), it didn't find the VS linker so it kept looking and found something called ld.exe in your PATH. It's hard to say whether this is a bug because we don't know anything about your environment. If you can reproduce this problem, I'm sure the experts would like to see it. But if all you have a is a CMake binary directory of unknown age and origin, that's not so helpful. tyler ___ 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] combining cmake and qmake
On Wed, Mar 03, 2010 at 11:01:14AM -0500, Hicham Mouline wrote: Qt comes with qmake which takes .pro files as input and also generates Makefiles or vs2008 solution files. Is there a generally advised policy re combining systems with both cmake and qmake? Take a look at CMake's FindQt4 module. You don't need qmake (and I would recommend avoiding it since you're already using CMake for cross-platform building). tyler ___ 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] file (GLOB) on linux with CMake 2.8
On Mon, Mar 01, 2010 at 09:21:36AM -0600, Ryan Pavlik wrote: any case, you probably don't want to do this. Instead, do an ls in Agree with this. your directory to get a list of files, and do a set(SOURCES) command and paste your file list in, or some similar technique. See this link for some info on why: http://www.cmake.org/cmake/help/cmake2.6docs.html#command:aux_source_directory Your technique (use ls) is no better than file(GLOB) because either way the logic is only run at CMake configure time which leads to CMake not knowing when it needs to regenerate your build files. The best practice (which I heartily recommend) is to hardcode the list of files into your CMakeLists.txt. tyler ___ 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] Watcom Support
Don't know about the watcom stuff but as for this: On Mon, Mar 01, 2010 at 07:03:14PM -0800, J Decker wrote: Is there really only a set of CMAKE_C_FLAGS_ and _CXX_FLAGS_? no companion _LD_FLAGS_ ? Properties rather than global variables but is this what you mean? http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LINK_FLAGS tyler ___ 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] Adding a generated source to all multiple targets
On Wed, Feb 24, 2010 at 07:23:55PM -0600, Oliver kfsone Smith wrote: Ok - I just wanted to make sure there wasn't some built-in way of doing it before I plowed ahead with that :) Nope. Writing your own wrapper for add_* commands seems to be a pretty common practice. making all the config variables for that target match the form dbproxy_WHATEVER lets you say stuff like: add_library(${this_target} ${${this_target}_SOURCE_FILES} ...) Hmm - I didn't know you could do that, so I've been doing everything project relative, but then the size of this project and the number of sub-targets, and the huge amount of shared code between targets means that things aren't really organized by target, so all of the targets sit in one top-level project. You are definitely not the first build engineer tasked with modernizing a crufty legacy codebase. I recommend making friends with add_subdirectory() as soon as you can. Once you start breaking the build up into parts, it becomes easier to manage. The external project stuff may also be worth a look, but probably not until you tease some modules out of your big ball of mud. tyler ___ 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] Include subdirectories
On Thu, Feb 25, 2010 at 09:56:24PM +0100, Christian Werner wrote: I am sure this has been asked before, but somehow I don't find a place where I can easily browse the mailing list postings (I just found that link where you can browse isolated months). I am writing plugins for Yeah I just noticed that google used to turn up cmake.org/pipermail links but now is returning article.gmane.org links. I agree that the gmane.org archives are difficult to navigate. ParaView and I want to know how I can make cmake recursively search all subdirectories for included .h files. For example I have: INCLUDE_DIRECTORIES( ${PV_PLUGIN_DIR}/Filter ${PV_PLUGIN_DIR}/Segmentation ${PV_PLUGIN_DIR}/Transformation ${PV_PLUGIN_DIR}/vtk2itk2vtk ) But all these directories contain no .h file. Instead they consist of subdirectories, each containing their own .h files. For every Paraview Plugin I write there will be a new subdirectory, e.g. ${PV_PLUGIN_DIR}/Segmentation/DisDyn It would be nice if I wasn't forced to enter every new directory into some CMakelist. Yes, this is deliberate. CMake wants you to specify all the include dirs so that when you add one (or remove one), CMake can notice that your project has changed and regenerate your build files for you. It's the same reason CMake wants you to specify the names of all your source files, instead of just compiling *.cpp. You could hack around this with file(GLOB) or something else, but I don't recommend it. Just maintain all the include dirs into your CMakeLists.txt; it's not that hard and in exchange you get a more reliable build process. tyler ___ 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] Adding a generated source to all multiple targets
On Wed, Feb 24, 2010 at 05:17:27PM -0600, Oliver kfsone Smith wrote: That's half the problem solved -- the bulk of the post was, though: I want to automatically generate one of these per-target, so that the tolua runs with per-target compiler switches, and so that the resulting .cc file is compiled with the per-target compile flags plus any specific flags needed to compile that source. I would write a wrapper for add_library() and/or add_executable() that does the normal add_*() stuff and then also sets up the custom command for generating the lua.*.cc files. I.e. the origin file is lua.pkg; For target dbproxy I want to run tolua++ -n game ${db_proxy_definitions} ${common_definitions} -o ${Foo_BINARY_DIR}/lua.dbproxy.cc ${Foo_SOURCE_DIR}/lua.pkg For target statsd I want to run tolua++ -n game ${statsd_definitions} ${common_definitions} -o ${Foo_BINARY_DIR}/lua.statsd.cc ${Foo_SOURCE_DIR}/lua.pkg If these are real examples from your code, I would strongly suggest normalizing your variable names. If the target is called dbproxy then making all the config variables for that target match the form dbproxy_WHATEVER lets you say stuff like: add_library(${this_target} ${${this_target}_SOURCE_FILES} ...) tyler ___ 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] Regular Expression to filter out C/C++ Comments
On Mon, Feb 22, 2010 at 04:28:54PM +0100, Andreas Lubensky wrote: i'm having some trouble building a regular expression to filter out C and C++ style comments (//... /*...*/). I constructed various regular ((/\\*([^\\*]|(\\*+([^\\*/])))*\\*+/)|(//[^\r\n]*)) I don't think RE are the right tool for this job. You probably want a little state machine instead (something like 'while (token != '*/') { skip_token() }). Why are you trying to do this? Can you do the parsing in a real scripting language instead of in CMake? tyler ___ 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