[CMake] Regenerating project files based on external file.
The short version of what I'm trying to do: Add some kind of definition to the cmake file that specifies a file, that if modified, will cause the project to be regenerated. Longer (more specific) version. We (our small program team) want's to use cmake to generate a file svn_version.h, which has a solution posted on the web. The problem happens when we checkout new revisions, this file goes unmodified. Looking for a way to cause CMake to regenerate the build files (and with it, the revision number) after an svn up command, without having to touch cmakelists.txt. It would be trivial to simply check files in the .svn folder for modification times, so that would probably be the easiest (although not 100% accurate) way to go. Any help on where to look... 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
[CMake] Windows build inconsistency...
I've noticed an inconsistency in CMake's generation.. For example I go through the following sequence: cd \Project mkdir Debug cd Debug Then I either: cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug ..\CMakeLists.txt It will generate, and then place the project files in \Project. But if I use: cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug .. It will generate, and then place the project files in \Project\Debug Why are these different? Are the differences expected behavior? I'm a bit confused.. 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
[CMake] Compile flags for a single file
I've been trying most things I can think of, but have been unable to come up with a solution.. the basic gist is I need to change the compile flags for a SINGLE file within a project. Specifically, disabling all compile warnings for that file. add_definitions() seems to effect the whole project, so that's not helping.. Also couldn't use set_property() to do it either. (I could have been using it wrong). Thanks! Extra nonsense: If you're wondering why, it mostly has to do with politics. An outside vendor wrote that file and we are not allowed to modify it... and they refuse to fix the warnings. We're also required to treat warnings as errors, so this comes as a stand-still and breaks automated build machines, as after the projects are generated, they have to manually be updated (right now.). ___ 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] Compile flags for a single file
On Mon, 18 Apr 2011 21:52:31 +0200, Alexander Neundorf wrote: On Monday 18 April 2011, The Novice Coder wrote: I've been trying most things I can think of, but have been unable to come up with a solution.. the basic gist is I need to change the compile flags for a SINGLE file within a project. Specifically, disabling all compile warnings for that file. add_definitions() seems to effect the whole project, so that's not helping.. Also couldn't use set_property() to do it either. (I could have been using it wrong). set_source_files_properties() should be able to set COMPILE_FLAGS for single files. * you might also write a file which only does some #define/#undef's and then includes the file in question ? * you might build a static library consisting only of that one file, if necessary in an own subdirectory (which has only the CMakeLists.txt with add_library(foo STATIC ../the_file.c), basically) Alex Thank you very much! That got me on the right path. If anyone else has the same issue, the final code was: if(MSVC) set_source_files_properties( ${contrib_db_cpp} PROPERTIES COMPILE_FLAGS /W0 ) endif(MSVC) ___ 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