mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-02 00:10:22 +02:00
CMake: massive rework for Mac build and other improvements
- macOS: RPATH-related code all removed or disabled - macOS: new osx/CMakeLists.txt to run some install-code running after all subdirectories - Assets copying into the runtime output directory implemented for Mac and Linux development
This commit is contained in:
parent
7dca95c8cc
commit
40af43c46e
@ -39,7 +39,4 @@ vcmi_set_output_dir(BattleAI "AI")
|
||||
set_target_properties(BattleAI PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(BattleAI)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS BattleAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
||||
endif()
|
||||
|
||||
|
@ -22,6 +22,4 @@ vcmi_set_output_dir(EmptyAI "AI")
|
||||
|
||||
set_target_properties(EmptyAI PROPERTIES ${PCH_PROPERTIES})
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS EmptyAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
||||
endif(NOT APPLE)
|
||||
|
@ -23,7 +23,4 @@ vcmi_set_output_dir(StupidAI "AI")
|
||||
set_target_properties(StupidAI PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(StupidAI)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS StupidAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
||||
endif()
|
||||
|
||||
|
@ -42,6 +42,4 @@ vcmi_set_output_dir(VCAI "AI")
|
||||
set_target_properties(VCAI PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(VCAI)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS VCAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
||||
endif()
|
||||
|
110
CMakeLists.txt
110
CMakeLists.txt
@ -1,4 +1,15 @@
|
||||
project(VCMI)
|
||||
# TODO
|
||||
# - macOS: there is problem with running fixup_bundle in main project after subdirectories.
|
||||
# Cmake put them after all install code of main CMakelists in cmake_install.cmake
|
||||
# Currently I just added extra add_subdirectory and CMakeLists.txt in osx directory to bypass that.
|
||||
# - macOS: fix install with built-in minizip
|
||||
# - macOS: try to fix build with RPATH.
|
||||
# Currently if CMAKE_MACOSX_RPATH=1 then AI libs unable to find @rpath/libvcmi.dylib
|
||||
# I tried to set few different INSTALL_RPATH for all targets in AI directory, but nothing worked.
|
||||
# - build: cleanup remove_directory copy_directory mess.
|
||||
# When I was trying to fix it copy_if_different failed to work for me.
|
||||
# - build: and find a way to move add_custom_command for assets deploy out of "lib/CMakeLists.txt"
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
@ -6,7 +17,6 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo)
|
||||
endif()
|
||||
set(CMAKE_MACOSX_RPATH 1)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake_modules)
|
||||
include(VCMIUtils)
|
||||
@ -20,6 +30,9 @@ option(ENABLE_LAUNCHER "Enable compilation of launcher" ON)
|
||||
option(ENABLE_TEST "Enable compilation of unit tests" ON)
|
||||
option(ENABLE_PCH "Enable compilation using precompiled headers" ON)
|
||||
|
||||
# Useful for debugging
|
||||
option(ENABLE_MONOLITHIC_INSTALL "Install everything in single directory on Linux and Mac" OFF)
|
||||
|
||||
# Allow to pass package name from Travis CI
|
||||
set(PACKAGE_NAME_SUFFIX "" CACHE STRING "Suffix for CPack package name")
|
||||
set(PACKAGE_FILE_NAME "" CACHE STRING "Override for CPack package filename")
|
||||
@ -37,6 +50,11 @@ else()
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
endif()
|
||||
|
||||
# Find better place for this
|
||||
if(APPLE)
|
||||
set(CMAKE_MACOSX_RPATH 0)
|
||||
endif()
|
||||
|
||||
############################################
|
||||
# Documentation section #
|
||||
############################################
|
||||
@ -84,7 +102,7 @@ if(WIN32)
|
||||
endif(WIN32)
|
||||
|
||||
if(NOT WIN32)
|
||||
INCLUDE(CheckLibraryExists)
|
||||
include(CheckLibraryExists)
|
||||
|
||||
#check if some platform-specific libraries are needed for linking
|
||||
CHECK_LIBRARY_EXISTS(rt shm_open "" HAVE_RT_LIB)
|
||||
@ -147,13 +165,29 @@ elseif(APPLE)
|
||||
# includes lib path which determines where to install shared libraries (either /lib or /lib64)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(ENABLE_MONOLITHIC_INSTALL)
|
||||
set(BIN_DIR "." CACHE STRING "Where to install binaries")
|
||||
set(LIB_DIR "." CACHE STRING "Where to install main library")
|
||||
set(DATA_DIR "../h3" CACHE STRING "Where to install data files")
|
||||
set(DATA_DIR "." CACHE STRING "Where to install data files")
|
||||
else()
|
||||
set(APP_BUNDLE_DIR "${CMAKE_PROJECT_NAME}.app")
|
||||
set(APP_BUNDLE_CONTENTS_DIR "${APP_BUNDLE_DIR}/Contents")
|
||||
set(APP_BUNDLE_BINARY_DIR "${APP_BUNDLE_CONTENTS_DIR}/MacOS")
|
||||
set(APP_BUNDLE_RESOURCES_DIR "${APP_BUNDLE_CONTENTS_DIR}/Resources")
|
||||
|
||||
set(BIN_DIR "${APP_BUNDLE_BINARY_DIR}" CACHE STRING "Where to install binaries")
|
||||
set(LIB_DIR "${APP_BUNDLE_BINARY_DIR}" CACHE STRING "Where to install main library")
|
||||
set(DATA_DIR "${APP_BUNDLE_RESOURCES_DIR}/Data" CACHE STRING "Where to install data files")
|
||||
endif()
|
||||
else()
|
||||
# includes lib path which determines where to install shared libraries (either /lib or /lib64)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(ENABLE_MONOLITHIC_INSTALL)
|
||||
set(BIN_DIR "." CACHE STRING "Where to install binaries")
|
||||
set(LIB_DIR "." CACHE STRING "Where to install main library")
|
||||
set(DATA_DIR "." CACHE STRING "Where to install data files")
|
||||
else()
|
||||
if(NOT BIN_DIR)
|
||||
set(BIN_DIR "bin" CACHE STRING "Where to install binaries")
|
||||
endif()
|
||||
@ -164,6 +198,7 @@ else()
|
||||
set(DATA_DIR "share/vcmi" CACHE STRING "Where to install data files")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(AI_LIB_DIR "${LIB_DIR}/AI")
|
||||
set(SCRIPTING_LIB_DIR "${LIB_DIR}/scripting")
|
||||
@ -173,11 +208,8 @@ add_definitions(-DM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}")
|
||||
add_definitions(-DM_BIN_DIR="${CMAKE_INSTALL_PREFIX}/${BIN_DIR}")
|
||||
add_definitions(-DM_LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/vcmi")
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# precompiled header configuration
|
||||
SET(PCH_PROPERTIES
|
||||
set(PCH_PROPERTIES
|
||||
COTIRE_ENABLE_PRECOMPILED_HEADER ${ENABLE_PCH}
|
||||
COTIRE_ADD_UNITY_BUILD FALSE
|
||||
COTIRE_CXX_PREFIX_HEADER_INIT "StdInc.h"
|
||||
@ -205,12 +237,8 @@ endif()
|
||||
# Installation section #
|
||||
#######################################
|
||||
|
||||
# For apple these files will be already inside vcmiclient bundle
|
||||
if(NOT APPLE)
|
||||
# copy whole directory but .svn control files
|
||||
install(DIRECTORY config DESTINATION ${DATA_DIR})
|
||||
# copy vcmi mod along with all its content
|
||||
install(DIRECTORY Mods/vcmi DESTINATION ${DATA_DIR}/Mods)
|
||||
install(DIRECTORY Mods DESTINATION ${DATA_DIR})
|
||||
|
||||
# that script is useless for Windows
|
||||
if(NOT WIN32)
|
||||
@ -219,20 +247,6 @@ if(NOT APPLE)
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
#install icons and desktop file on Linux
|
||||
#FIXME: move to client makefile?
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.64x64.png" DESTINATION share/icons/hicolor/64x64/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.48x48.png" DESTINATION share/icons/hicolor/48x48/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.32x32.png" DESTINATION share/icons/hicolor/32x32/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.256x256.png" DESTINATION share/icons/hicolor/256x256/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.desktop" DESTINATION share/applications)
|
||||
if(ENABLE_LAUNCHER) #FIXME: move to launcher makefile?
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/launcher/vcmilauncher.desktop" DESTINATION share/applications)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#######################################
|
||||
# Packaging section #
|
||||
@ -248,12 +262,6 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
|
||||
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||
|
||||
INSTALL(CODE "
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"${APP_BUNDLE_DIR}\" \"\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
|
||||
if("${PACKAGE_NAME_SUFFIX}" STREQUAL "")
|
||||
set(CPACK_PACKAGE_NAME "VCMI")
|
||||
else()
|
||||
@ -277,17 +285,23 @@ if(WIN32)
|
||||
set(CPACK_NSIS_PACKAGE_NAME "VCMI ${CPACK_PACKAGE_VERSION} ${PACKAGE_NAME_SUFFIX} ")
|
||||
endif()
|
||||
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||
if(ENABLE_LAUNCHER)
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " CreateShortCut \\\"$DESKTOP\\\\VCMI.lnk\\\" \\\"$INSTDIR\\\\VCMI_launcher.exe\\\"")
|
||||
else()
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " CreateShortCut \\\"$DESKTOP\\\\VCMI.lnk\\\" \\\"$INSTDIR\\\\VCMI_client.exe\\\"")
|
||||
endif()
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS " Delete \\\"$DESKTOP\\\\VCMI.lnk\\\" ")
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake_modules/CMakeCPackOptions.cmake.in" "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
|
||||
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
|
||||
elseif(APPLE)
|
||||
elseif(APPLE AND NOT ENABLE_MONOLITHIC_INSTALL)
|
||||
set(CPACK_MONOLITHIC_INSTALL 1)
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/osx/dmg_background.png")
|
||||
set(CPACK_DMG_DS_STORE "${CMAKE_SOURCE_DIR}/osx/dmg_DS_Store")
|
||||
|
||||
set(MACOSX_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
if(ENABLE_LAUNCHER)
|
||||
set(MACOSX_BUNDLE_EXECUTABLE_NAME "vcmilauncher")
|
||||
else()
|
||||
@ -295,31 +309,13 @@ elseif(APPLE)
|
||||
endif()
|
||||
set(MACOSX_BUNDLE_ICON_FILE "vcmi.icns")
|
||||
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/config/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/config/)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Mods/vcmi/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/Mods/vcmi/)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/launcher/icons/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/launcher/icons/)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/osx/vcmi.icns" DESTINATION ${APP_BUNDLE_RESOURCES_DIR})
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/osx/vcmi.icns DESTINATION ${APP_BUNDLE_RESOURCES_DIR})
|
||||
configure_file("${CMAKE_SOURCE_DIR}/osx/Info.plist.in" "${CMAKE_BINARY_DIR}/Info.plist")
|
||||
install(FILES "${CMAKE_BINARY_DIR}/Info.plist" DESTINATION ${APP_BUNDLE_CONTENTS_DIR})
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/osx/Info.plist.in
|
||||
"${APP_BUNDLE_CONTENTS_DIR}/Info.plist")
|
||||
|
||||
if(ENABLE_LAUNCHER)
|
||||
find_program(TOOL_MACDEPLOYQT NAMES macdeployqt PATHS ${qt_base_dir}/bin)
|
||||
if(NOT TOOL_MACDEPLOYQT)
|
||||
message(FATAL_ERROR "Could not find macdeployqt")
|
||||
endif()
|
||||
string(REPLACE " " "\\ " ESCAPED_BUNDLE_DIR ${APP_BUNDLE_DIR})
|
||||
install(CODE "execute_process(COMMAND ${TOOL_MACDEPLOYQT} ${ESCAPED_BUNDLE_DIR} -verbose=2)")
|
||||
endif()
|
||||
|
||||
INSTALL(CODE "
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"${APP_BUNDLE_DIR}\" \"\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
|
||||
install(DIRECTORY ${APP_BUNDLE_DIR} DESTINATION "." USE_SOURCE_PERMISSIONS)
|
||||
# Bundle fixing code must be in separate directory to be executed after all other install code
|
||||
add_subdirectory(osx)
|
||||
else()
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
endif()
|
||||
@ -328,4 +324,4 @@ include(GetGitRevisionDescription)
|
||||
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Version.cpp.in" "${CMAKE_BINARY_DIR}/Version.cpp" @ONLY)
|
||||
|
||||
INCLUDE(CPack)
|
||||
include(CPack)
|
||||
|
@ -143,6 +143,14 @@ vcmi_set_output_dir(vcmiclient "")
|
||||
set_target_properties(vcmiclient PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(vcmiclient)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
|
||||
endif(NOT APPLE)
|
||||
|
||||
#install icons and desktop file on Linux
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
#FIXME: move to client makefile?
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.64x64.png" DESTINATION share/icons/hicolor/64x64/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.48x48.png" DESTINATION share/icons/hicolor/48x48/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.32x32.png" DESTINATION share/icons/hicolor/32x32/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.256x256.png" DESTINATION share/icons/hicolor/256x256/apps RENAME vcmiclient.png)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/client/icons/vcmiclient.desktop" DESTINATION share/applications)
|
||||
endif()
|
||||
|
@ -1,16 +1,6 @@
|
||||
#######################################
|
||||
# Output directories #
|
||||
# Build output directories #
|
||||
#######################################
|
||||
if(APPLE)
|
||||
set(MACOSX_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")
|
||||
set(APP_BUNDLE_DIR "${CMAKE_BINARY_DIR}/build/${APP_BUNDLE_NAME}")
|
||||
set(APP_BUNDLE_CONTENTS_DIR "${APP_BUNDLE_DIR}/Contents")
|
||||
set(APP_BUNDLE_BINARY_DIR "${APP_BUNDLE_CONTENTS_DIR}/MacOS")
|
||||
set(APP_BUNDLE_RESOURCES_DIR "${APP_BUNDLE_CONTENTS_DIR}/Resources")
|
||||
endif()
|
||||
|
||||
macro(vcmi_set_output_dir name dir)
|
||||
# Multi-config builds for Visual Studio, Xcode
|
||||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
|
@ -110,8 +110,16 @@ vcmi_set_output_dir(vcmilauncher "")
|
||||
#set_target_properties(vcmilauncher PROPERTIES ${PCH_PROPERTIES})
|
||||
#cotire(vcmilauncher)
|
||||
|
||||
if(NOT APPLE) # Already inside bundle
|
||||
# Copy to build directory for easier debugging
|
||||
add_custom_command(TARGET vcmilauncher POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/launcher/icons ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/launcher/icons
|
||||
)
|
||||
|
||||
install(TARGETS vcmilauncher DESTINATION ${BIN_DIR})
|
||||
# copy whole directory
|
||||
install(DIRECTORY icons DESTINATION ${DATA_DIR}/launcher)
|
||||
# Install icons and desktop file on Linux
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
install(FILES "vcmilauncher.desktop" DESTINATION share/applications)
|
||||
endif()
|
||||
|
@ -308,6 +308,12 @@ vcmi_set_output_dir(vcmi "")
|
||||
set_target_properties(vcmi PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(vcmi)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
# We want to deploy assets into build directory for easier debugging without install
|
||||
add_custom_command(TARGET vcmi POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/config
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/Mods
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/config ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/config
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Mods ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/Mods
|
||||
)
|
||||
|
||||
install(TARGETS vcmi RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR})
|
||||
endif()
|
||||
|
@ -452,7 +452,7 @@ bfs::path VCMIDirsOSX::userConfigPath() const { return userDataPath() / "config"
|
||||
|
||||
std::vector<bfs::path> VCMIDirsOSX::dataPaths() const
|
||||
{
|
||||
return std::vector<bfs::path>(1, "../Data");
|
||||
return std::vector<bfs::path>(1, "../Resources/Data");
|
||||
}
|
||||
|
||||
bfs::path VCMIDirsOSX::libraryPath() const { return "."; }
|
||||
|
@ -19,6 +19,4 @@ vcmi_set_output_dir(minizip "")
|
||||
|
||||
target_link_libraries(minizip ${ZLIB_LIBRARIES})
|
||||
|
||||
if (NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS minizip RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR})
|
||||
endif()
|
||||
|
18
osx/CMakeLists.txt
Normal file
18
osx/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
# We need to keep this code into separate directory so CMake will execute it after all other subdirectories install code
|
||||
# Otherwise we can't fix Mac bundle dependencies since binaries wouldn't be there when this code executed
|
||||
if(APPLE)
|
||||
if(ENABLE_LAUNCHER)
|
||||
find_program(TOOL_MACDEPLOYQT NAMES macdeployqt PATHS ${qt_base_dir}/bin)
|
||||
if(NOT TOOL_MACDEPLOYQT)
|
||||
message(FATAL_ERROR "Could not find macdeployqt")
|
||||
endif()
|
||||
install(CODE "
|
||||
execute_process(COMMAND ${TOOL_MACDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}\" -verbose=2)")
|
||||
endif()
|
||||
|
||||
install(CODE "
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}\" \"\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
endif(APPLE)
|
@ -41,6 +41,4 @@ vcmi_set_output_dir(vcmiserver "")
|
||||
set_target_properties(vcmiserver PROPERTIES ${PCH_PROPERTIES})
|
||||
cotire(vcmiserver)
|
||||
|
||||
if(NOT APPLE) # Already inside vcmiclient bundle
|
||||
install(TARGETS vcmiserver DESTINATION ${BIN_DIR})
|
||||
endif()
|
||||
|
@ -2,8 +2,8 @@ enable_testing()
|
||||
|
||||
set(googleTest_Dir ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
||||
if(EXISTS ${googleTest_Dir})
|
||||
SET(GTestSrc ${googleTest_Dir}/googletest)
|
||||
SET(GMockSrc ${googleTest_Dir}/googlemock)
|
||||
set(GTestSrc ${googleTest_Dir}/googletest)
|
||||
set(GMockSrc ${googleTest_Dir}/googlemock)
|
||||
else()
|
||||
message(FATAL_ERROR "No googletest src dir found!")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user