Hi Steve, 2014-09-10 0:32 GMT+02:00 Stephen Kelly <steve...@gmail.com>: > > > I wonder what a cmake-based buildsystem would look like for a collection of > executables/targets which should be built for multiple ... >
I would generalize even more and finish the sentence with "options at once". This includes Debug/Release, Shared/Static, PlatformA/PlatformB, etc. With usage-requirements we now can propagate properties from dependees to dependents. What about the other direction? Imagine this: add_library(foo STATIC foo.cpp) add_library(bar SHARED bar.cpp) target_link_libraries(bar foo) add_executable(myexe main.cpp) target_link_libraries(myexe foo) A static library foo is used both in a shared library and in an executable. Depending on the platform it should be build twice: once with PIC, once without. Another example: We sometimes run code generators as custom buildsteps. add_library(foo foo.cpp) add_executable(codegen codegen.cpp) # set_target_properties(codegen PROPERTIES BUILD_FOR_HOST 1) target_link_libraries(codegen foo) add_custom_command(OUTPUT source.cpp COMMAND codegen) add_executable(myexe source.cpp) target_link_libraries(myexe foo) When crosscompiling, we need the codegenerator for the host platform (This would need some target property). But more interestingly, the library foo should be built for both the host and the target(s). Thank you for starting that discussion! -- Daniel
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers