Fixed: Compilation with old CMake versions

This commit is contained in:
kervala 2016-11-23 12:30:18 +01:00
parent 8b53cc8af9
commit aafab8a909

View file

@ -176,10 +176,21 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
IF(CMAKE_VERSION VERSION_LESS "3.3.0")
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND _FLAGS ${_directory_flags})
LIST(APPEND _FLAGS ${_directory_definitions})
GET_DIRECTORY_PROPERTY(_DIRECTORY_FLAGS DEFINITIONS)
IF(_DIRECTORY_FLAGS)
FOREACH(item ${_DIRECTORY_FLAGS})
LIST(APPEND _FLAGS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(_DIRECTORY_DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
IF(_DIRECTORY_DEFINITIONS)
FOREACH(item ${_DIRECTORY_DEFINITIONS})
LIST(APPEND _FLAGS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
ENDFOREACH()
ENDIF()
ENDIF()
# Format definitions