@ -56,33 +56,37 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
LIST ( APPEND _FLAGS " -I\" ${ item } \"")
LIST ( APPEND _FLAGS " -I\" ${ item } \"")
ENDFOREACH ( )
ENDFOREACH ( )
# N O T E : A s c m a k e files ( eg FindQT4 ) m a y n o w u s e g e n e r a t o r e x p r e s s i o n s a r o u n d t h e i r d e f i n e s t h a t e v a l u a t e
# t o a n e m p t y s t r i n g , w r a p a l l " i t e m s " i n a n e x p r e s s i o n t h a t o u t p u t s a - D I F F t h e g e n e r a t e d
# e x p r e s s i o n i s n o t e m p t y .
# R e q u i r e d f o r C M a k e 2 . 6
# R e q u i r e d f o r C M a k e 2 . 6
SET ( GLOBAL_DEFINITIONS )
SET ( GLOBAL_DEFINITIONS )
GET_DIRECTORY_PROPERTY ( DEFINITIONS COMPILE_DEFINITIONS )
GET_DIRECTORY_PROPERTY ( DEFINITIONS COMPILE_DEFINITIONS )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
GET_DIRECTORY_PROPERTY ( DEFINITIONS COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
GET_DIRECTORY_PROPERTY ( DEFINITIONS COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
GET_DIRECTORY_PROPERTY ( DEFINITIONS DIRECTORY ${ CMAKE_SOURCE_DIR } COMPILE_DEFINITIONS )
GET_DIRECTORY_PROPERTY ( DEFINITIONS DIRECTORY ${ CMAKE_SOURCE_DIR } COMPILE_DEFINITIONS )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
GET_DIRECTORY_PROPERTY ( DEFINITIONS DIRECTORY ${ CMAKE_SOURCE_DIR } COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
GET_DIRECTORY_PROPERTY ( DEFINITIONS DIRECTORY ${ CMAKE_SOURCE_DIR } COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
@ -106,14 +110,14 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_TARGET_PROPERTY ( DEFINITIONS ${ _target } COMPILE_DEFINITIONS )
GET_TARGET_PROPERTY ( DEFINITIONS ${ _target } COMPILE_DEFINITIONS )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
GET_TARGET_PROPERTY ( DEFINITIONS ${ _target } COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
GET_TARGET_PROPERTY ( DEFINITIONS ${ _target } COMPILE_DEFINITIONS_ ${ _UPPER_BUILD } )
IF ( DEFINITIONS )
IF ( DEFINITIONS )
FOREACH ( item ${ DEFINITIONS } )
FOREACH ( item ${ DEFINITIONS } )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item} ")
LIST ( APPEND GLOBAL_DEFINITIONS " $<$<BOOL:${item}>:-D$<JOIN:${item},-D>> ")
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
@ -135,10 +139,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF ( _DEFINITIONS )
IF ( _DEFINITIONS )
FOREACH ( item ${ _DEFINITIONS } )
FOREACH ( item ${ _DEFINITIONS } )
# d o n ' t u s e d y n a m i c e x p r e s s i o n s
LIST ( APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>" )
IF ( NOT item MATCHES "\\$<" )
LIST ( APPEND GLOBAL_DEFINITIONS " -D${item}" )
ENDIF ( )
ENDFOREACH ( )
ENDFOREACH ( )
ENDIF ( )
ENDIF ( )
ENDIF ( )
ENDIF ( )
@ -162,8 +163,6 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF ( )
ENDIF ( )
ENDIF ( )
ENDIF ( )
LIST ( APPEND _FLAGS " ${GLOBAL_DEFINITIONS}" )
IF ( CMAKE_VERSION VERSION_LESS "3.3.0" )
IF ( CMAKE_VERSION VERSION_LESS "3.3.0" )
GET_DIRECTORY_PROPERTY ( _directory_flags DEFINITIONS )
GET_DIRECTORY_PROPERTY ( _directory_flags DEFINITIONS )
GET_DIRECTORY_PROPERTY ( _directory_definitions DIRECTORY ${ CMAKE_SOURCE_DIR } DEFINITIONS )
GET_DIRECTORY_PROPERTY ( _directory_definitions DIRECTORY ${ CMAKE_SOURCE_DIR } DEFINITIONS )
@ -180,6 +179,9 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
SEPARATE_ARGUMENTS ( _FLAGS )
SEPARATE_ARGUMENTS ( _FLAGS )
ENDIF ( )
ENDIF ( )
# A l r e a d y i n l i s t f o r m a n d i t e m s m a y c o n t a i n n o n - l e a d i n g s p a c e s t h a t s h o u l d n o t b e s p l i t o n
LIST ( INSERT _FLAGS 0 "${GLOBAL_DEFINITIONS}" )
IF ( CLANG )
IF ( CLANG )
# D e t e r m i n i n g a l l a r c h i t e c t u r e s a n d g e t c o m m o n f l a g s
# D e t e r m i n i n g a l l a r c h i t e c t u r e s a n d g e t c o m m o n f l a g s
SET ( _ARCH_NEXT )
SET ( _ARCH_NEXT )