Re: [CMake] set_source_files_properties for includedirectories
Michael Hertling ha scritto: On 11/23/2010 03:23 PM, Andrea Galeazzi wrote: Marcel Loose ha scritto: On 23-11-2010 at 10:55, in message 4ceb8f76.80...@korg.it, Andrea Galeazzi galea...@korg.it wrote: In a project I've got two groups of files having different include paths. These paths have some conflicts so I need to specify just one for each file requires it. My first idea was to apply set_source_files_properties with a property like include_directories but I don't find anything similar. My next attempt is gonna use the COMPILE_FLAGS property, does anybody know a more efficient and elegant way to accomplish a such task? An equivalent issue was discussed in this thread http://www.mail-archive.com/cmake@cmake.org/msg05276.html but I didn't find any useful answer. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake Hi Andrea, As you noted include_directories is a per-directory setting. So, if you're free to reorganize your source files, you could put the two groups of files in two different directories. Then you can use include_directories() in each directory. Make sure you don't make one of these directories a subdirectory of the other. HTH, Marcel Loose. __ Informazioni da ESET NOD32 Antivirus, versione del database delle firme digitali 5639 (20101122) __ Il messaggio stato controllato da ESET NOD32 Antivirus. www.nod32.it Yes, the sources are splitted in different directories but the CMakeLists.txt is just one: -Root CMakeLists.txt -dir1 file1.cpp file2.cpp .. -dir2 file1.cpp file2.cpp . I'd like to generate just one IDE project from this project. FYI, see [1] and especially [2]. Regards, Michael [1] http://public.kitware.com/Bug/view.php?id=1968 [2] http://public.kitware.com/Bug/view.php?id=8189 ___ 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 __ Informazioni da ESET NOD32 Antivirus, versione del database delle firme digitali 5647 (20101125) __ Il messaggio stato controllato da ESET NOD32 Antivirus. www.nod32.it Sorry, I don't understand, what's [1] or [2]? ___ 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 25-11-2010 at 17:34, in message 201011251734.55788.johannes.z...@jku.at, Johannes Zarl johannes.z...@jku.at wrote: I took the liberty and compiled such a compatibility matrix here: http://www.cmake.org/Wiki/CMake_Version_Compatibility_Matrix It's a draft and does not (yet) contain information about properties and variables, but if this idea receives general consent I could complete the information. What do you think? Is this worth the effort, or would no one ever bother to update the information? NICE !! I think this is really handy and definitely worth the effort. However, how's keeping http://www.cmake.org/Wiki/CMake_Released_Versions up-to-date? Since, you're matrix is just a user-friendly representation of that information. 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
Re: [CMake] providing library information, what's the cmake way
2010/11/25 Johannes Zarl johannes.z...@jku.at: On Wednesday 24 November 2010 19:03:21 David Cole wrote: On Wed, Nov 24, 2010 at 12:58 PM, Tyler Roscoe ty...@cryptio.net wrote: 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 That does sound like a good idea. From the information in http://www.cmake.org/Wiki/CMake_Released_Versions and using some shell-scripts to create the diffs between all neighbor-versions, it's not too much work to create a compatibility matrix for the documented features. May be it can be fully automated suche that adding a column for each new CMake release would take minimum time? I took the liberty and compiled such a compatibility matrix here: http://www.cmake.org/Wiki/CMake_Version_Compatibility_Matrix It's a draft and does not (yet) contain information about properties and variables, but if this idea receives general consent I could complete the information. What do you think? Is this worth the effort, or would no one ever bother to update the information? I like it too, I think it's very handy. Concerning the update I think I will be done (and I may help) if some scripts pre-digest the informations to be laid out. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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] How to get the current date
Hello, Is it possible in a CMakeLists.txt file to get the current date (under linux and windows) ? I would like to store this date in a cmake variable so as to write it in a .h file. YC ___ 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 get the current date
2010/11/26 ycollette.nos...@free.fr: Hello, Is it possible in a CMakeLists.txt file to get the current date (under linux and windows) ? I would like to store this date in a cmake variable so as to write it in a .h file. CMake has no builtin for that but if you search the ML archive http://www.cmake.org/Wiki/CMake_FAQ#Where_can_I_find_searchable_CMake_Mailing_Archives.3F you'll find several discussions (and solution proposal) on this subject. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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 get the current date
Thanks for the link: http://www.cmake.org/pipermail/cmake/2009-February/027014.html seems to answer my question. YC - Mail Original - De: Eric Noulard eric.noul...@gmail.com À: ycollette nospam ycollette.nos...@free.fr Cc: cmake cmake@cmake.org Envoyé: Vendredi 26 Novembre 2010 13h35:30 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [CMake] How to get the current date 2010/11/26 ycollette.nos...@free.fr: Hello, Is it possible in a CMakeLists.txt file to get the current date (under linux and windows) ? I would like to store this date in a cmake variable so as to write it in a .h file. CMake has no builtin for that but if you search the ML archive http://www.cmake.org/Wiki/CMake_FAQ#Where_can_I_find_searchable_CMake_Mailing_Archives.3F you'll find several discussions (and solution proposal) on this subject. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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] set CMAKE_INSTALL_PREFIX in CMakeLists
And *NEVER EVER* set CMAKE_INSTALL_PREFIX in your CMakeLists.txt file. That is a user-setting and you will make people angry at you if you override their choice in your code. There is actually one single use-case where it might be useful to change this variable once: Say you have a library libFoo installed in /path/to/libfoo. Now you like to have an add-on library. You might want to normally install this library to the same location where the base library is. The CMake file here can set the CMAKE_INSTALL_PREFIX to /path/to/libfoo _once_. (I actually hope that there will never be a real libFoo in the world... I like to use the name in my mails) ___ 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 get the current date
Hello, The version found in the archive doesn't works under windows XP 64 bits. So here is a little modified one (date seems to be a command from the cmd executable ...): MACRO (TODAY RESULT) IF (WIN32) EXECUTE_PROCESS(COMMAND cmd /C date /T OUTPUT_VARIABLE ${RESULT}) string(REGEX REPLACE (..)/(..)/..(..).* \\1/\\2/\\3 ${RESULT} ${${RESULT}}) ELSEIF(UNIX) EXECUTE_PROCESS(COMMAND date +%d/%m/%Y OUTPUT_VARIABLE ${RESULT}) string(REGEX REPLACE (..)/(..)/..(..).* \\1/\\2/\\3 ${RESULT} ${${RESULT}}) ELSE (WIN32) MESSAGE(SEND_ERROR date not implemented) SET(${RESULT} 00) ENDIF (WIN32) ENDMACRO (TODAY) ... TODAY(RESULT) message(STATUS Compilation date = ${RESULT}) YC - Mail Original - De: ycollette nospam ycollette.nos...@free.fr À: cmake cmake@cmake.org Envoyé: Vendredi 26 Novembre 2010 14h09:48 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [CMake] How to get the current date Thanks for the link: http://www.cmake.org/pipermail/cmake/2009-February/027014.html seems to answer my question. YC - Mail Original - De: Eric Noulard eric.noul...@gmail.com À: ycollette nospam ycollette.nos...@free.fr Cc: cmake cmake@cmake.org Envoyé: Vendredi 26 Novembre 2010 13h35:30 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [CMake] How to get the current date 2010/11/26 ycollette.nos...@free.fr: Hello, Is it possible in a CMakeLists.txt file to get the current date (under linux and windows) ? I would like to store this date in a cmake variable so as to write it in a .h file. CMake has no builtin for that but if you search the ML archive http://www.cmake.org/Wiki/CMake_FAQ#Where_can_I_find_searchable_CMake_Mailing_Archives.3F you'll find several discussions (and solution proposal) on this subject. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Trouble with set_test_properties
Hello. I have some trouble with set_test_properties function. Let's say I want to add something to the environment (DLL path for instance). I use the following code in my CMakeLists.txt: set_tests_properties(Prog PROPERTIES ENVIRONMENT CONFIG=${CTEST_CONFIGURATION_TYPE}) When processed by cmake, the resulting CtestTestfile.cmake shows: SET_TESTS_PROPERTIES(Prog PROPERTIES ENVIRONMENT CONFIG=) That's fine, I need to protect the variable using: set_tests_properties(Prog PROPERTIES ENVIRONMENT CONFIG=\${CTEST_CONFIGURATION_TYPE}) But the resulting CTestTestfile.cmake shows: SET_TESTS_PROPERTIES(Prog PROPERTIES ENVIRONMENT CONFIG=\${CTEST_CONFIGURATION_TYPE}) Which won't get expanded while running ctest! How could I make my variable get expanded by ctest and not by cmake? How can I solve my problem? Thanks. ___ 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 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. Zach, do you agree? Sure do, this is a bug. I'll take a look at it today. -Zach Thanks, David On Tue, Nov 23, 2010 at 5:36 PM, Tyler Roscoe ty...@cryptio.net wrote: 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 ___ 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 just realized why this isn't working -- it's actually not a regression. 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. The non-parallel way to specify a test to run last is simply to make it the last add_test call. -Zach 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. Zach, do you agree? Sure do, this is a bug. I'll take a look at it today. -Zach Thanks, David On Tue, Nov 23, 2010 at 5:36 PM, Tyler Roscoe ty...@cryptio.net wrote: 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 ___ 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] Kitware at RSNA in Chicago next week
If you plan to be in Chicago next week for the 96th Scientific Assembly and Annual Meeting of the Radiological Society of North America (RSNA), please stop by the Kitware exhibit at booth number 1305, Lakeside Hall D. We will be highlighting the many open source algorithms, resources, and tools available for biomedical imaging research and product development. We will also have a showcase exhibit all week on the open source lesion sizing toolkit in the Quantitative Imaging Reading Room. We will be teaching a course on Open Source Tools for Medical Research and Applications, and we will present a scientific abstract on early results of a new CT pocket phantom capable of acquiring fundamental image acquisition properties with each patient scan. We encourage you to stop by the Kitware booth to discuss potential projects, learn more about upcoming additions to open source imaging toolkits, or explore career opportunities at Kitware. If you'd like to schedule a time to meet with a Kitware representative during the conference, please send email to kitw...@kitware.com. If you would like apply for one of our open positions (http://www.kitware.com/jobs), please send your resume and cover letter to j...@kitware.com. For full details on this event, visit our event page at http://www.kitware.com/events/home/event/105?2010-11-28+01%3A00%3A00RSNA+2010 . ___ 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] Relink on library rebuild dilema
Hi, I have a somewhat weird setup to build binaries for the Cell processor: |-- CMakeLists.txt |-- kernels | |-- CMakeLists.txt | `-- kernel.cpp `-- main.cpp From the main.cpp in the root directory the executable is built. In the kernels folder strange things (have to) happen: first the kernel.cpp is compiled with a custom compiler (I use a combination of SET, CMAKE_C_COMPILER and ADD_EXECUTABLE), then this binary is converted into a library using a custom POST_BUILD command that calls a special tool to do just that. If the binary is called kernel_executable_bin, the custom command generates a file libkernel_executable.a Now I have to link this library to my main executable (built from main.cpp). What I did so far is to put in the kernels/CMakeLists.txt file: add_dependencies(main_target kernel_executable_bin) and in the /CMakeLists.txt file: link_directories(${CMAKE_CURRENT_BINARY_DIR}/kernels/) target_link_libraries(main_target kernel_executable) This works as expected for one ugly flaw: if I only change kernels/kernel.cpp it won't relink the main_target. I have thus far been unsuccessful in getting this to work. I've tried various combinations of add_library(STATIC IMPORTED) and add_custom_target(DEPENDS) but it won't work. Any ideas would be greatly appreciated. Sebastian ___ 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] Forcing 'out-of-source' build
Hi All, I want to force an 'out-of-source' build for a small project that I converted to use Cmake. I did a bit of searching and found variants of the following... # Make sure the build is out of source STRING(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource) IF(insource) MESSAGE(FATAL_ERROR Do not build in your source dir please :)) ENDIF(insource) It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I've also seen others discussing)... is there a more official way to block 'in-source' builds that leaves the source dir pristine? Brian Wylie - Org 1424 Sandia National Laboratories MS 1323 - Building CSRI/242 (505)844-2238 FAX(505)284-2518 ___ __ /_ __(_) /_ _ / / / / __/ __ `/ __ \ / / / / /_/ /_/ / / / / /_/ /_/\__/\__,_/_/ /_/ Scalable Analysis and Visualization ___ 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] [Titan-developers] Forcing 'out-of-source' build
I am not sure if you can prevent it from generating those files but you could remove those files with file(REMOVE ...) in your IF(insource) block. On Fri, Nov 26, 2010 at 3:24 PM, Wylie, Brian bnwy...@sandia.gov wrote: Hi All, I want to force an 'out-of-source' build for a small project that I converted to use Cmake. I did a bit of searching and found variants of the following... # Make sure the build is out of source STRING(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource) IF(insource) MESSAGE(FATAL_ERROR Do not build in your source dir please :)) ENDIF(insource) It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I've also seen others discussing)... is there a more official way to block 'in-source' builds that leaves the source dir pristine? Brian Wylie - Org 1424 Sandia National Laboratories MS 1323 - Building CSRI/242 (505)844-2238 FAX(505)284-2518 ___ __ /_ __(_) /_ _ / / / / __/ __ `/ __ \ / / / / /_/ /_/ / / / / /_/ /_/\__/\__,_/_/ /_/ Scalable Analysis and Visualization ___ Titan-developers mailing list titan-develop...@public.kitware.com http://public.kitware.com/cgi-bin/mailman/listinfo/titan-developers ___ 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] [Titan-developers] Forcing 'out-of-source' build
On Fri, Nov 26, 2010 at 3:24 PM, Wylie, Brian bnwy...@sandia.gov wrote: Hi All, I want to force an 'out-of-source' build for a small project that I converted to use Cmake. I did a bit of searching and found variants of the following... # Make sure the build is out of source STRING(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource) IF(insource) MESSAGE(FATAL_ERROR Do not build in your source dir please :)) ENDIF(insource) It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I've also seen others discussing)... is there a more official way to block 'in-source' builds that leaves the source dir pristine? This was discussed recently by the ITK community, the best they came up with was making CMake give instructions on how to clean up your source tree. Hopefully this link works, and you can see what I mean, http://www.itk.org/gitweb?p=ITK.git;a=blob;f=CMake/PreventInSourceBuilds.cmake;h=78f6b4e63ab7b08ec87146f61adbb791a178;hb=HEAD Marcus ___ 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] Forcing 'out-of-source' build
2010/11/26 Wylie, Brian bnwy...@sandia.gov: Hi All, I want to force an 'out-of-source' build for a small project that I converted to use Cmake. I did a bit of searching and found variants of the following... # Make sure the build is out of source STRING(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource) IF(insource) MESSAGE(FATAL_ERROR Do not build in your source dir please :)) ENDIF(insource) It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I've also seen others discussing)... is there a more official way to block 'in-source' builds that leaves the source dir pristine? There is a feature request pending for this (with one duplicate) http://www.vtk.org/Bug/view.php?id=6672 -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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] Forcing 'out-of-source' build
I'd recommend this: touch CMakeCache.txt touch CMakeFiles Check said files into your revision control system. The fact that it can't create a directory alone makes cmake freak out almost immediately. Juan On Fri, Nov 26, 2010 at 3:06 PM, Eric Noulard eric.noul...@gmail.comwrote: 2010/11/26 Wylie, Brian bnwy...@sandia.gov: Hi All, I want to force an 'out-of-source' build for a small project that I converted to use Cmake. I did a bit of searching and found variants of the following... # Make sure the build is out of source STRING(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource) IF(insource) MESSAGE(FATAL_ERROR Do not build in your source dir please :)) ENDIF(insource) It works but it still generates a CMakeCache.txt file and a CMakeFiles directory in the source directory (which I've also seen others discussing)... is there a more official way to block 'in-source' builds that leaves the source dir pristine? There is a feature request pending for this (with one duplicate) http://www.vtk.org/Bug/view.php?id=6672 -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ 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] providing library information, what's the cmake way
On Friday 26 November 2010 10:49:01 Eric Noulard wrote: From the information in http://www.cmake.org/Wiki/CMake_Released_Versions and using some shell-scripts to create the diffs between all neighbor-versions, it's not too much work to create a compatibility matrix for the documented features. May be it can be fully automated suche that adding a column for each new CMake release would take minimum time? Unfortunately, I don't think that's possible. After all, the information has to be gathered comparing the textual output of cmake --help-full. While most differences are pretty straightforward to interpret (at least for a human reader), sometimes the documentation changes and you really have to read the different versions and decide if there really was a change in behaviour, or if it's just a documentation change. I took the liberty and compiled such a compatibility matrix here: http://www.cmake.org/Wiki/CMake_Version_Compatibility_Matrix It's a draft and does not (yet) contain information about properties and variables, but if this idea receives general consent I could complete the information. What do you think? Is this worth the effort, or would no one ever bother to update the information? I like it too, I think it's very handy. Concerning the update I think I will be done (and I may help) if some scripts pre-digest the informations to be laid out. I don't have any time for this matter before next Thursday, but regarding the positive reactions on this list I will certainly complete the matrix. Eric: I can send you the shell-scripts if you want to have a look... Have a nice weekend, Johannes ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] cmake config.h
Greetings, I am learning cmake. I have a package that compiles fine with autoconf but fails with cmake. (The former generates automatically a required header-file config.h ) I have checked the cmake mailing list to see if the autoheader utility has been ported to cmake. This seems unclear. So I would be gateful if someone on list could verify if this facility is/isNOT (..yet) available using cmake. (And if it is -how it is used) sincerely luxInteg ___ 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] Relink on library rebuild dilema
On 11/26/2010 05:00 PM, Sebastian Schaetz wrote: Hi, I have a somewhat weird setup to build binaries for the Cell processor: |-- CMakeLists.txt |-- kernels | |-- CMakeLists.txt | `-- kernel.cpp `-- main.cpp From the main.cpp in the root directory the executable is built. In the kernels folder strange things (have to) happen: first the kernel.cpp is compiled with a custom compiler (I use a combination of SET, CMAKE_C_COMPILER and ADD_EXECUTABLE), then this binary is converted into a library using a custom POST_BUILD command that calls a special tool to do just that. If the binary is called kernel_executable_bin, the custom command generates a file libkernel_executable.a Now I have to link this library to my main executable (built from main.cpp). What I did so far is to put in the kernels/CMakeLists.txt file: add_dependencies(main_target kernel_executable_bin) and in the /CMakeLists.txt file: link_directories(${CMAKE_CURRENT_BINARY_DIR}/kernels/) target_link_libraries(main_target kernel_executable) This works as expected for one ugly flaw: if I only change kernels/kernel.cpp it won't relink the main_target. I have thus far been unsuccessful in getting this to work. I've tried various combinations of add_library(STATIC IMPORTED) and add_custom_target(DEPENDS) but it won't work. Any ideas would be greatly appreciated. Despite TARGET_LINK_LIBRARIES(), there's no dependency of main_target on libkernel_executable.a, so main_target isn't relinked if the kernel stuff is rebuilt. Nevertheless, there're some approaches I could offer: 1) In the top-level CMakeLists.txt, you might say SET_SOURCE_FILES_PROPERTIES( main.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kernels/libkernel_executable.a ) When libkernel_executable.a has changed, this results in recompiling main.cpp - a penalty - and the desired relinking of main_target. If main.cpp's recompilation is expensive you may possibly add an empty cpp file to main_target's sources and impose the property on that. 2) In kernels/CMakeLists.txt, add the following lines FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/empty.c) ADD_LIBRARY(empty STATIC empty.c) ADD_CUSTOM_COMMAND(TARGET kernel_executable_bin POST_BUILD COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/empty.c ) or enhance the custom command which creates libkernel_executable.a from kernel_executable_bin by the cmake -E touch shown above. Finally, in the top-level CMakeLists.txt, say: TARGET_LINK_LIBRARIES(main_target kernel_executable empty) When kernels/kernel.cpp has changed the kernel_executable_bin and libkernel_executable.a are rebuilt as usual, but kernels/empty.c is touched by the way. This results in rebuilding libempty.a which in turn makes main_target be relinked since it depends on the empty library. If there's trouble with an empty static library just write some dummy code in kernels/empty.c that you don't refer to from anywhere in the project. 3) If you get along with Makefiles you may possibly use a script in junction with the RULE_LAUNCH_LINK target property to generate the libkernel_executable.a from kernel_executable_bin as an actual target like ADD_LIBRARY(kernel_executable STATIC ) ADD_DEPENDENCIES(kernel_executable kernel_executable_bin) so the TARGET_LINK_LIBRARIES(main_target kernel_executable) in the top-level CMakeLists.txt should be sufficient to trigger the linker. 'hope that helps. Regards, Michael ___ 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] Forcing 'out-of-source' build
Hi, On Sat, Nov 27, 2010 at 01:11:06AM -0500, cmake-requ...@cmake.org wrote: Message: 5 Date: Fri, 26 Nov 2010 15:55:55 -0600 From: j s j.s4...@gmail.com Subject: Re: [CMake] Forcing 'out-of-source' build To: Eric Noulard eric.noul...@gmail.com I'd recommend this: touch CMakeCache.txt touch CMakeFiles Check said files into your revision control system. ... _and make sure to document that intent within their content_ (perhaps confined to CMakeCache.txt, since that is a .txt file compatible with Windows expectations). And add a simple see CMakeCache.txt to CMakeFiles. (not that anyone unclever enough would ever happen to read these files before getting rid of them in sub-seconds, but...) The fact that it can't create a directory alone makes cmake freak out almost immediately. Interesting variant - seems like there are a hundred ways to Rome ;) Andreas Mohr ___ 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