Jump to content

Image of the Day

Setting up a playground for our bad boys... #maya #gameart #screenshotsaturday #gamedev https://t.co/V5mfxWkzHg
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

CMake - Macros for 2 projects

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Alundra   Members   

2085
Like
0Likes
Like

Posted 04 November 2012 - 07:45 PM

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}
)


Thanks

Edited by Alundra, 04 November 2012 - 07:46 PM.


#2 Alundra   Members   

2085
Like
0Likes
Like

Posted 05 November 2012 - 03:00 PM

I've found the solution :

set_target_properties(
ProjectD3D11
PROPERTIES COMPILE_FLAGS
-DAPI_DIRECT3D11
)






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.