mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
use component-based install to copy only what's needed for every app
This commit is contained in:
parent
fae295da88
commit
3388583089
@ -38,4 +38,4 @@ target_link_libraries(BattleAI PRIVATE vcmi)
|
|||||||
vcmi_set_output_dir(BattleAI "AI")
|
vcmi_set_output_dir(BattleAI "AI")
|
||||||
enable_pch(BattleAI)
|
enable_pch(BattleAI)
|
||||||
|
|
||||||
install(TARGETS BattleAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
install(TARGETS BattleAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR} COMPONENT AI)
|
||||||
|
@ -137,7 +137,7 @@ target_link_libraries(Nullkiller PRIVATE TBB::tbb)
|
|||||||
vcmi_set_output_dir(Nullkiller "AI")
|
vcmi_set_output_dir(Nullkiller "AI")
|
||||||
enable_pch(Nullkiller)
|
enable_pch(Nullkiller)
|
||||||
|
|
||||||
install(TARGETS Nullkiller RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR} OPTIONAL)
|
install(TARGETS Nullkiller RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR} COMPONENT AI OPTIONAL)
|
||||||
if(APPLE_IOS)
|
if(APPLE_IOS)
|
||||||
install(IMPORTED_RUNTIME_ARTIFACTS TBB::tbb LIBRARY DESTINATION ${LIB_DIR} OPTIONAL) # CMake 3.21+
|
install(IMPORTED_RUNTIME_ARTIFACTS TBB::tbb LIBRARY DESTINATION ${LIB_DIR} COMPONENT AI OPTIONAL) # CMake 3.21+
|
||||||
endif()
|
endif()
|
||||||
|
@ -20,4 +20,4 @@ target_include_directories(StupidAI PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|||||||
vcmi_set_output_dir(StupidAI "AI")
|
vcmi_set_output_dir(StupidAI "AI")
|
||||||
enable_pch(StupidAI)
|
enable_pch(StupidAI)
|
||||||
|
|
||||||
install(TARGETS StupidAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
install(TARGETS StupidAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR} COMPONENT AI)
|
||||||
|
@ -112,4 +112,4 @@ target_link_libraries(VCAI PRIVATE vcmi fuzzylite::fuzzylite)
|
|||||||
vcmi_set_output_dir(VCAI "AI")
|
vcmi_set_output_dir(VCAI "AI")
|
||||||
enable_pch(VCAI)
|
enable_pch(VCAI)
|
||||||
|
|
||||||
install(TARGETS VCAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR})
|
install(TARGETS VCAI RUNTIME DESTINATION ${AI_LIB_DIR} LIBRARY DESTINATION ${AI_LIB_DIR} COMPONENT AI)
|
||||||
|
@ -423,9 +423,9 @@ endif()
|
|||||||
# Installation section #
|
# Installation section #
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
install(DIRECTORY config DESTINATION ${DATA_DIR})
|
install(DIRECTORY config DESTINATION ${DATA_DIR} COMPONENT core)
|
||||||
install(DIRECTORY scripts DESTINATION ${DATA_DIR})
|
install(DIRECTORY scripts DESTINATION ${DATA_DIR} COMPONENT core)
|
||||||
install(DIRECTORY Mods DESTINATION ${DATA_DIR})
|
install(DIRECTORY Mods DESTINATION ${DATA_DIR} COMPONENT core)
|
||||||
|
|
||||||
# that script is useless for Windows
|
# that script is useless for Windows
|
||||||
if(NOT WIN32 AND NOT APPLE_IOS)
|
if(NOT WIN32 AND NOT APPLE_IOS)
|
||||||
|
@ -228,7 +228,8 @@ enable_pch(vcmiclient)
|
|||||||
|
|
||||||
if(APPLE_IOS)
|
if(APPLE_IOS)
|
||||||
add_custom_command(TARGET vcmiclient POST_BUILD
|
add_custom_command(TARGET vcmiclient POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
|
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --component core --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
|
||||||
|
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --component AI --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
@ -131,9 +131,10 @@ vcmi_set_output_dir(vcmilauncher "")
|
|||||||
enable_pch(vcmilauncher)
|
enable_pch(vcmilauncher)
|
||||||
|
|
||||||
if(APPLE_IOS)
|
if(APPLE_IOS)
|
||||||
install(DIRECTORY icons DESTINATION ${DATA_DIR})
|
install(DIRECTORY icons DESTINATION ${DATA_DIR} COMPONENT launcher)
|
||||||
add_custom_command(TARGET vcmilauncher POST_BUILD
|
add_custom_command(TARGET vcmilauncher POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmilauncher>"
|
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --component core --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmilauncher>"
|
||||||
|
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --component launcher --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmilauncher>"
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
@ -491,4 +491,19 @@ if(TARGET update_version)
|
|||||||
add_dependencies(vcmi update_version)
|
add_dependencies(vcmi update_version)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS vcmi RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR})
|
install(TARGETS vcmi RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR} COMPONENT core)
|
||||||
|
if(APPLE_IOS)
|
||||||
|
get_target_property(LINKED_LIBS vcmi LINK_LIBRARIES)
|
||||||
|
foreach(LINKED_LIB IN LISTS LINKED_LIBS)
|
||||||
|
if(TARGET ${LINKED_LIB})
|
||||||
|
get_target_property(LIB_TYPE ${LINKED_LIB} TYPE)
|
||||||
|
if(LIB_TYPE STREQUAL "SHARED_LIBRARY")
|
||||||
|
install(TARGETS ${LINKED_LIB} LIBRARY DESTINATION ${LIB_DIR} COMPONENT core)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(LINKED_LIB MATCHES "\\${CMAKE_SHARED_LIBRARY_SUFFIX}$")
|
||||||
|
install(FILES ${LINKED_LIB} DESTINATION ${LIB_DIR} COMPONENT core)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
@ -33,7 +33,6 @@ if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
|||||||
set(server_LIBS execinfo ${server_LIBS})
|
set(server_LIBS execinfo ${server_LIBS})
|
||||||
elseif(APPLE_IOS)
|
elseif(APPLE_IOS)
|
||||||
set(server_LIBS ${server_LIBS} "-framework UIKit")
|
set(server_LIBS ${server_LIBS} "-framework UIKit")
|
||||||
add_dependencies(vcmiserver BattleAI StupidAI VCAI)
|
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
|
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
|
||||||
|
|
||||||
@ -72,7 +71,7 @@ enable_pch(vcmiserver)
|
|||||||
if(APPLE_IOS)
|
if(APPLE_IOS)
|
||||||
# TODO: move to a common dir / add macro?
|
# TODO: move to a common dir / add macro?
|
||||||
add_custom_command(TARGET vcmiserver POST_BUILD
|
add_custom_command(TARGET vcmiserver POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiserver>"
|
COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --component core --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiserver>"
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
COMMAND ${CMAKE_SOURCE_DIR}/apple_codesign.sh
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
Loading…
Reference in New Issue
Block a user