Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread Rob McDonald
On Mon, Jan 20, 2014 at 7:39 AM, J Decker wrote: > On Mon, Jan 20, 2014 at 7:37 AM, Игорь Пашев > wrote: > > 2014/1/20 Rob McDonald : > >> We also have an API/Library mode with no main(), but that can have > graphics > >> or not. > > > > So, one will have the library with unpredictable API/ABI?

Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread J Decker
On Mon, Jan 20, 2014 at 7:37 AM, Игорь Пашев wrote: > 2014/1/20 Rob McDonald : >> We also have an API/Library mode with no main(), but that can have graphics >> or not. > > So, one will have the library with unpredictable API/ABI? > Ya; probably something like VLC, that gets a predictable API late

Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread Eric Noulard
If you need two versions of the same executable you'll have to do something like; add_executable(exe1 same_source.cpp) add_executable(exe2 same_source.cpp) set_target_properties(exe2 PROPERTIES COMPILE_FLAGS "-DFOO=1") then exe2 will be compiled with -DFOO. you can put a specific property on a s

Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread J Decker
It's actually very simple. Use target properties to set the flags you need (assuming that said flag doesn't break other sources) SET_PROPERTY(TARGET bag.video.puregl2 APPEND PROPERTY COMPILE_DEFINITIONS "RENDER_LIBRARY_SOURCE;_OPENGL_ENABLED;_OPENGL_DRIVER;MAKE_RCOORD_SINGLE" ) You can also copy

Re: [CMake] Compiling two versions of file/program

2014-01-20 Thread Игорь Пашев
2014/1/20 Rob McDonald : > We also have an API/Library mode with no main(), but that can have graphics > or not. So, one will have the library with unpredictable API/ABI? > > I'd like to use CMake to compile both versions of these in one go. However, > I don't see any way to make a -DFOO for jus

[CMake] Compiling two versions of file/program

2014-01-20 Thread Rob McDonald
My project can be compiled with support for graphics, or in a completely headless mode with no dependencies on any graphics libraries. By and large, this is accomplished with the same source code and a very few #define 's. We also have an API/Library mode with no main(), but that can have graphic