Skip to main content
GameDev.net gamedev.net
🔒 Locked

CMake - Macros for 2 projects

Started by Alundra Nov 5, 2012 at 1:45 AM 0 replies 1k views
Original Post
Alundra
Alundra
Hi,
I'm using CMake to make 2 projects who is the same but with differents macros.
It creates me 2 project but adds all macros for both.
Is it possible to just assign macro for one and another macros for the second project ?

here, what I do :

file(
GLOB_RECURSE
source_files
src/*
inc/*
)

if(WINDOWS)
add_definitions(-DAPI_DIRECT3D11)
add_library(
ProjectD3D11
STATIC
${source_files}
)
endif()

add_definitions(-DAPI_OPENGL)
add_definitions(-DGLEW_STATIC)
add_definitions(-DSFML_STATIC)
add_library(
ProjectOGL
STATIC
${source_files}
)
[/quote]

Thanks
Alundra
Alundra
I've found the solution :


set_target_properties(
ProjectD3D11
PROPERTIES COMPILE_FLAGS
-DAPI_DIRECT3D11
)
[/quote]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.