2011-10-29 19:37:30 +02:00
|
|
|
macro(optional_source TOGGLE)
|
|
|
|
parse_arguments(OPTIONAL_SOURCE
|
|
|
|
"SOURCES;HEADERS;UI;INCLUDE_DIRECTORIES"
|
|
|
|
""
|
|
|
|
${ARGN}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(${TOGGLE})
|
|
|
|
list(APPEND SOURCES ${OPTIONAL_SOURCE_SOURCES})
|
|
|
|
list(APPEND HEADERS ${OPTIONAL_SOURCE_HEADERS})
|
|
|
|
list(APPEND UI ${OPTIONAL_SOURCE_UI})
|
|
|
|
include_directories(${OPTIONAL_SOURCE_INCLUDE_DIRECTORIES})
|
|
|
|
else(${TOGGLE})
|
|
|
|
list(APPEND OTHER_SOURCES ${OPTIONAL_SOURCE_SOURCES})
|
|
|
|
list(APPEND OTHER_SOURCES ${OPTIONAL_SOURCE_HEADERS})
|
2011-11-03 18:19:37 +01:00
|
|
|
|
|
|
|
set(_uic_sources)
|
2015-04-11 22:49:34 +02:00
|
|
|
qt5_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
|
2011-11-03 18:19:37 +01:00
|
|
|
list(APPEND OTHER_SOURCES ${_uic_sources})
|
|
|
|
list(APPEND OTHER_UIC_SOURCES ${_uic_sources})
|
2011-10-29 19:37:30 +02:00
|
|
|
endif(${TOGGLE})
|
|
|
|
endmacro(optional_source)
|