mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-17 20:58:07 +02:00
Merge pull request #5227 from kambala-decapitator/cmake-improvements
CMake improvements
This commit is contained in:
commit
ca21adc93f
@ -35,6 +35,7 @@ if(NOT fuzzylite_FOUND)
|
||||
add_compile_options(-Wno-error=deprecated-declarations)
|
||||
endif()
|
||||
add_subdirectory(FuzzyLite/fuzzylite EXCLUDE_FROM_ALL)
|
||||
set_property(TARGET fl-static PROPERTY CXX_STANDARD 14) # doesn't compile under 17 due to using removed symbol(s)
|
||||
add_library(fuzzylite::fuzzylite ALIAS fl-static)
|
||||
target_include_directories(fl-static PUBLIC ${CMAKE_HOME_DIRECTORY}/AI/FuzzyLite/fuzzylite)
|
||||
endif()
|
||||
|
@ -157,7 +157,7 @@ else()
|
||||
endif()
|
||||
|
||||
target_include_directories(Nullkiller PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(Nullkiller PUBLIC vcmi fuzzylite::fuzzylite)
|
||||
target_link_libraries(Nullkiller PUBLIC vcmi fuzzylite::fuzzylite TBB::tbb)
|
||||
|
||||
vcmi_set_output_dir(Nullkiller "AI")
|
||||
enable_pch(Nullkiller)
|
||||
|
@ -25,6 +25,13 @@ if(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0142)
|
||||
cmake_policy(SET CMP0142 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0177)
|
||||
cmake_policy(SET CMP0177 NEW)
|
||||
endif()
|
||||
|
||||
############################################
|
||||
# User-provided options #
|
||||
############################################
|
||||
@ -870,7 +877,9 @@ elseif(APPLE_MACOS AND NOT ENABLE_MONOLITHIC_INSTALL)
|
||||
# Workaround for this issue:
|
||||
# CPack Error: Error executing: /usr/bin/hdiutil detach "/Volumes/VCMI"
|
||||
# https://github.com/actions/runner-images/issues/7522#issuecomment-1564467252
|
||||
if(DEFINED ENV{GITHUB_RUN_ID})
|
||||
set(CPACK_COMMAND_HDIUTIL "/usr/bin/sudo /usr/bin/hdiutil")
|
||||
endif()
|
||||
# CMake code for CPACK_DMG_DS_STORE executed before DS_STORE_SETUP_SCRIPT
|
||||
# So we can keep both enabled and this shouldn't hurt
|
||||
# set(CPACK_DMG_DS_STORE "${CMAKE_SOURCE_DIR}/osx/dmg_DS_Store")
|
||||
|
@ -1,6 +1,5 @@
|
||||
if(ENABLE_INNOEXTRACT)
|
||||
add_subdirectory("lib/innoextract")
|
||||
add_definitions(-DENABLE_INNOEXTRACT)
|
||||
endif()
|
||||
|
||||
set(launcher_SRCS
|
||||
@ -219,6 +218,7 @@ vcmi_set_output_dir(vcmilauncher "")
|
||||
enable_pch(vcmilauncher)
|
||||
|
||||
if(ENABLE_INNOEXTRACT)
|
||||
target_compile_definitions(vcmilauncher PRIVATE ENABLE_INNOEXTRACT)
|
||||
target_link_libraries(vcmilauncher innoextract)
|
||||
endif()
|
||||
|
||||
|
@ -41,6 +41,11 @@ if(APPLE_MACOS)
|
||||
vcmi_install_conan_deps("${bundleContentsDir}")
|
||||
|
||||
# perform ad-hoc codesigning
|
||||
# Intel Macs don't need it
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(executablesToSign vcmiserver)
|
||||
if(ENABLE_EDITOR)
|
||||
list(APPEND executablesToSign vcmieditor)
|
||||
|
@ -9,10 +9,10 @@ set(serverapp_HEADERS
|
||||
|
||||
assign_source_group(${serverapp_SRCS} ${serverapp_HEADERS})
|
||||
add_executable(vcmiserver ${serverapp_SRCS} ${serverapp_HEADERS})
|
||||
set(serverapp_LIBS vcmi)
|
||||
|
||||
set(serverapp_LIBS vcmi)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD OR HAIKU)
|
||||
set(serverapp_LIBS execinfo ${serverapp_LIBS})
|
||||
list(APPEND serverapp_LIBS execinfo)
|
||||
endif()
|
||||
target_link_libraries(vcmiserver PRIVATE ${serverapp_LIBS} minizip::minizip vcmiservercommon)
|
||||
|
||||
|
@ -20,9 +20,11 @@ assign_source_group(${vcmiqt_SRCS} ${vcmiqt_HEADERS})
|
||||
if(ENABLE_STATIC_LIBS OR NOT (ENABLE_EDITOR AND ENABLE_LAUNCHER))
|
||||
add_library(vcmiqt STATIC ${vcmiqt_SRCS} ${vcmiqt_HEADERS})
|
||||
target_compile_definitions(vcmiqt PRIVATE VCMIQT_STATIC)
|
||||
set(TARGET_IS_SHARED OFF)
|
||||
else()
|
||||
add_library(vcmiqt SHARED ${vcmiqt_SRCS} ${vcmiqt_HEADERS})
|
||||
target_compile_definitions(vcmiqt PRIVATE VCMIQT_SHARED)
|
||||
set(TARGET_IS_SHARED ON)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
@ -39,7 +41,7 @@ target_include_directories(vcmiqt PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(NOT ENABLE_STATIC_LIBS OR (ENABLE_EDITOR AND ENABLE_LAUNCHER))
|
||||
if(TARGET_IS_SHARED)
|
||||
install(TARGETS vcmiqt RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR})
|
||||
endif()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user