I want to have two projects that build the same source files, the second one having only a small subset, as well as several different definition and assembly flags.
When I try something like this:
SET (this_target PROJECT1) PROJECT(${this_target}) ... ADD_EXECUTABLE(#{this_target} ...) SET (this_target PROJECT2) PROJECT(${this_target}) ... add_definitions (-DMYDEFINE) TARGET_LINK_LIBRARIES( ${this_target} -myflag ) ADD_EXECUTABLE(#{this_target} ...)
As a result, two projects are created, with seemingly correct source files, etc., but for some reason, at least in Visual Studio 2010, both projects seem to define MYDEFINE and myflag in the linker flags.
I'm not sure why this works for files, but not for flags.
source share