Export relevant static compile flags on windows.
Use target_compile_definitions to populate the INTERFACE_COMPILE_DEFINITIONS property on the freeglut_static target on windows.
This commit is contained in:
parent
d3839cd975
commit
ffc24cfb76
@ -392,10 +392,10 @@ ENDIF()
|
|||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
LIST(APPEND LIBS winmm)
|
LIST(APPEND LIBS winmm)
|
||||||
IF(FREEGLUT_BUILD_SHARED_LIBS)
|
IF(FREEGLUT_BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(freeglut PROPERTIES COMPILE_FLAGS -DFREEGLUT_EXPORTS)
|
TARGET_COMPILE_DEFINITIONS(freeglut PRIVATE FREEGLUT_EXPORTS)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(FREEGLUT_BUILD_STATIC_LIBS)
|
IF(FREEGLUT_BUILD_STATIC_LIBS)
|
||||||
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
|
TARGET_COMPILE_DEFINITIONS(freeglut_static PUBLIC FREEGLUT_STATIC)
|
||||||
# need to set machine:x64 for linker, at least for VC10, and
|
# need to set machine:x64 for linker, at least for VC10, and
|
||||||
# doesn't hurt for older compilers:
|
# doesn't hurt for older compilers:
|
||||||
# http://public.kitware.com/Bug/view.php?id=11240#c22768
|
# http://public.kitware.com/Bug/view.php?id=11240#c22768
|
||||||
@ -509,7 +509,6 @@ MACRO(ADD_DEMO name)
|
|||||||
IF(FREEGLUT_BUILD_STATIC_LIBS)
|
IF(FREEGLUT_BUILD_STATIC_LIBS)
|
||||||
ADD_EXECUTABLE(${name}_static ${ARGN})
|
ADD_EXECUTABLE(${name}_static ${ARGN})
|
||||||
TARGET_LINK_LIBRARIES(${name}_static ${DEMO_LIBS} freeglut_static)
|
TARGET_LINK_LIBRARIES(${name}_static ${DEMO_LIBS} freeglut_static)
|
||||||
SET_TARGET_PROPERTIES(${name}_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
|
|
||||||
IF(WIN32 AND MSVC)
|
IF(WIN32 AND MSVC)
|
||||||
SET_TARGET_PROPERTIES(${name}_static PROPERTIES DEBUG_POSTFIX d)
|
SET_TARGET_PROPERTIES(${name}_static PROPERTIES DEBUG_POSTFIX d)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
Reference in New Issue
Block a user