1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-16 02:35:27 +01:00
strawberry-audio-player-win.../cmake/OptionalSource.cmake

27 lines
813 B
CMake
Raw Normal View History

2018-02-27 18:06:05 +01: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})
set(_uic_sources)
2020-10-01 19:43:39 +02:00
if(BUILD_WITH_QT6)
2020-07-18 04:47:54 +02:00
qt6_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
else()
qt5_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
endif()
2018-02-27 18:06:05 +01:00
list(APPEND OTHER_SOURCES ${_uic_sources})
list(APPEND OTHER_UIC_SOURCES ${_uic_sources})
endif(${TOGGLE})
endmacro(optional_source)