1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-15 10:14:43 +01:00
strawberry-audio-player-win.../cmake/OptionalSource.cmake
2021-07-30 21:17:50 +02:00

23 lines
710 B
CMake

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})
set(_uic_sources)
qt_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
list(APPEND OTHER_SOURCES ${_uic_sources})
list(APPEND OTHER_UIC_SOURCES ${_uic_sources})
endif(${TOGGLE})
endmacro(optional_source)