I want to define a few targets which have certain properties (say, dependencies and link libraries), and then go on to define other targets without those properties.
add_executable(foo src/foo1.cpp)
add_dependencies(foo some_dependency)
target_link_libraries(foo mylib)
add_executable(bar src/bar2.cpp)
add_dependencies(bar some_dependency)
target_link_libraries(bar mylib)
add_executable(baz src/baz3.cpp)
add_dependencies(baz some_dependency)
target_link_libraries(baz mylib)
# and now without the dependencies...
add_executable(quux src/qux.cpp)
add_executable(quuz src/quuz.cpp)
Is there a nice idiom for pushing and popping the relevant properties instead?