Re: [CMake] Overriding CMAKE_C_FLAGS on a per-directory basis
Hello, Am Freitag, 8. Januar 2010 schrieb Marcel Loose: > If you've set the flags "-foo -bar" using add_definitions(), instead of > manipulating CMAKE_C_FLAGS directly, you can use > > set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "-baz") Currently I manually set CMAKE_Fortran_FLAGS_DEBUG where DEBUG is set inside CMAKE_BUILD_TYPE Does this add_definitions()-technique keep track of the build type? thx C.M. ___ 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] Overriding CMAKE_C_FLAGS on a per-directory basis
Hi Ingolf, If you've set the flags "-foo -bar" using add_definitions(), instead of manipulating CMAKE_C_FLAGS directly, you can use set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "-baz") to override the compile definitions for the current directory and its subdirectories. Hope this helps, Marcel Loose. On Fri, 2010-01-08 at 12:26 +0100, Ingolf Steinbach wrote: > Hi, > > is it possible to override CMAKE_C_FLAGS on a per-directory basis? I > have attempted to solve this by setting CMAKE_C_FLAGS to a different > value than the default used in the project, but this modification is > not reflected in the command line for compilation within the > directory. Example > > "global" CMAKE_C_FLAGS are "-foo -bar" > > some_dir/CMakeLists.txt: > [...] > set(CMAKE_C_FLAGS "-argl") > [...] > > Still sources in some_dir are compiled with "-foo -bar" rather than > with "-argl". > > > Also setting the COMPILE_FLAGS property via > set_source_files_properties() applied to the sources in some_dir would > only *append* the new flags to "-foo -bar" rather than replacing them. > > cmake 2.8 on Linux. > > Kind regards > Ingolf > ___ > 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] Overriding CMAKE_C_FLAGS on a per-directory basis
Hi, is it possible to override CMAKE_C_FLAGS on a per-directory basis? I have attempted to solve this by setting CMAKE_C_FLAGS to a different value than the default used in the project, but this modification is not reflected in the command line for compilation within the directory. Example "global" CMAKE_C_FLAGS are "-foo -bar" some_dir/CMakeLists.txt: [...] set(CMAKE_C_FLAGS "-argl") [...] Still sources in some_dir are compiled with "-foo -bar" rather than with "-argl". Also setting the COMPILE_FLAGS property via set_source_files_properties() applied to the sources in some_dir would only *append* the new flags to "-foo -bar" rather than replacing them. cmake 2.8 on Linux. Kind regards Ingolf ___ 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