Make QT library deployment optional via CMake option DEPLOY_QT_LIBRARIES (default off)

clonk_re-export
Sven Eberhardt 2018-02-15 21:40:25 -08:00
parent b95dd50564
commit 9c32ee0336
2 changed files with 11 additions and 8 deletions

View File

@ -43,6 +43,7 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_ADDITIONAL_DEPS_PATH})
############################################################################
include(CMakeDependentOption)
option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON)
option(DEPLOY_QT_LIBRARIES "Deploy Qt libraries to executable path" OFF)
CMAKE_DEPENDENT_OPTION(USE_COCOA "Use Apple Cocoa widgets." ON "APPLE" OFF)
CMAKE_DEPENDENT_OPTION(USE_WIN32_WINDOWS "Use Microsoft Desktop App User Interface widgets." ON "WIN32" OFF)
CMAKE_DEPENDENT_OPTION(USE_SDL_MAINLOOP "Use SDL to create windows etc. Qt editor." ON "NOT USE_COCOA AND NOT USE_WIN32_WINDOWS AND NOT HEADLESS_ONLY" OFF)
@ -1189,13 +1190,14 @@ if(NOT HEADLESS_ONLY)
target_link_libraries(openclonk Qt5::Widgets)
# Deploy dependency libraries and platforms/ folder
if(WIN32)
include(DeployQt)
windeployqt(openclonk)
elseif(APPLE)
# mac qt deploy disabled for now; doesn't seem to work on the autobuild server
# include(DeployQt)
# macdeployqt(nitroshare-client)
if(DEPLOY_QT_LIBRARIES)
if(WIN32)
include(DeployQt)
windeployqt(openclonk)
elseif(APPLE)
include(DeployQt)
macdeployqt(nitroshare-client)
endif()
endif()
endif()

View File

@ -43,7 +43,8 @@ function(windeployqt target)
# Run windeployqt immediately after build
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${WINDEPLOYQT_EXECUTABLE}"
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
--verbose 0
--no-compiler-runtime
--no-angle