Re: [CMake] Settings different flags in sub projects

2014-08-04 Thread David Zemon
Poking around some more I think I may have found a better solution. # Toolchain file include(FileWithInitFlags.cmake) set(CMAKE_C_COMPILE_OBJECT " ${CMAKE_C_FLAGS_INIT} -o -c ") And for the custom languages I can add that to CMakeInformation.cmake. I'm not sure why I didn't th

Re: [CMake] Settings different flags in sub projects

2014-08-04 Thread David Zemon
Glenn, thanks for the tip. Those two options are new to me. It's not very clear to me how the add_compile_options function works. Complexity might be added when I mention that I've also defined 4 new custom languages (all essentially identical to C). When add_compile_options is executed, will

Re: [CMake] Settings different flags in sub projects

2014-08-04 Thread Glenn Coombs
Something like this should work: add_compile_options(-std=c99) set_property(DIRECTORY "/root/p1" PROPERTY COMPILE_OPTIONS "-Os") set_property(DIRECTORY "/root/p2" PROPERTY COMPILE_OPTIONS "-O1") or you just use the add_compile_options command in all 3 CMakeLists.txt files. The CMakeLists.txt f

Re: [CMake] Settings different flags in sub projects

2014-08-03 Thread Magnus Therning
On Sun, Aug 03, 2014 at 05:46:40PM -0500, David Zemon wrote: > Hello, > > For the simple case of three directories and two projects - /root, /root/p1, > and /root/p2 - I would like to set some common flags for both projects and > then other flags should be independent. For instance, p1 should be c

[CMake] Settings different flags in sub projects

2014-08-03 Thread David Zemon
Hello, For the simple case of three directories and two projects - /root, /root/p1, and /root/p2 - I would like to set some common flags for both projects and then other flags should be independent. For instance, p1 should be compiled with "-std=c99 -Os" and p2 should be compiled with "-std=c