more deduplication of installed files

develop
Myk Taylor 2023-07-29 00:34:56 -07:00
parent ac633da050
commit 6a50ae42ce
No known key found for this signature in database
5 changed files with 36 additions and 30 deletions

@ -218,7 +218,7 @@ set(DFHACK_USERDOC_DESTINATION ${DFHACK_DATA_DESTINATION})
option(BUILD_LIBRARY "Build the DFHack library." ON) option(BUILD_LIBRARY "Build the DFHack library." ON)
option(BUILD_PLUGINS "Build the DFHack plugins." ON) option(BUILD_PLUGINS "Build the DFHack plugins." ON)
option(INSTALL_SCRIPTS "Install DFHack scripts." ON) option(INSTALL_SCRIPTS "Install DFHack scripts." ON)
option(INSTALL_DATA_FILES "Install DFHack common data files." ON) option(INSTALL_DATA_FILES "Install DFHack platform independent files." ON)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
if(UNIX) if(UNIX)
@ -407,20 +407,20 @@ if(NOT GIT_FOUND)
endif() endif()
# build the lib itself # build the lib itself
add_subdirectory(library)
if(BUILD_LIBRARY) if(BUILD_LIBRARY)
add_subdirectory(library) file(WRITE ${CMAKE_BINARY_DIR}/dfhack_setarch.txt ${DFHACK_SETARCH})
install(FILES LICENSE.rst DESTINATION ${DFHACK_USERDOC_DESTINATION}) install(FILES ${CMAKE_BINARY_DIR}/dfhack_setarch.txt DESTINATION ${DFHACK_DATA_DESTINATION})
install(FILES docs/changelog-placeholder.txt DESTINATION ${DFHACK_USERDOC_DESTINATION} RENAME changelog.txt)
endif() endif()
file(WRITE "${CMAKE_BINARY_DIR}/dfhack_setarch.txt" ${DFHACK_SETARCH})
install(FILES "${CMAKE_BINARY_DIR}/dfhack_setarch.txt" DESTINATION "${DFHACK_DATA_DESTINATION}")
# build the plugins # build the plugins
add_subdirectory(plugins) add_subdirectory(plugins)
if(INSTALL_DATA_FILES) if(INSTALL_DATA_FILES)
add_subdirectory(data) add_subdirectory(data)
install(FILES LICENSE.rst DESTINATION ${DFHACK_USERDOC_DESTINATION})
install(FILES docs/changelog-placeholder.txt DESTINATION ${DFHACK_USERDOC_DESTINATION} RENAME changelog.txt)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/depends/luacov/src/luacov/ DESTINATION ${DFHACK_DATA_DESTINATION}/lua/luacov)
endif() endif()
if(INSTALL_SCRIPTS) if(INSTALL_SCRIPTS)

@ -39,8 +39,6 @@ option(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependenc
add_subdirectory(clsocket) add_subdirectory(clsocket)
ide_folder(clsocket "Depends") ide_folder(clsocket "Depends")
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/luacov/src/luacov/ DESTINATION ${DFHACK_DATA_DESTINATION}/lua/luacov)
# set the default values of libexpat options - the descriptions are left empty # set the default values of libexpat options - the descriptions are left empty
# because later option() calls *do* override those # because later option() calls *do* override those
set(EXPAT_BUILD_EXAMPLES OFF CACHE BOOL "") set(EXPAT_BUILD_EXAMPLES OFF CACHE BOOL "")

@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.21)
# prevent CMake warnings about INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES # prevent CMake warnings about INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES
cmake_policy(SET CMP0022 NEW) cmake_policy(SET CMP0022 NEW)
if(BUILD_LIBRARY)
# build options # build options
if(UNIX) if(UNIX)
option(CONSOLE_NO_CATCH "Make the console not catch 'CTRL+C' events for easier debugging." OFF) option(CONSOLE_NO_CATCH "Make the console not catch 'CTRL+C' events for easier debugging." OFF)
@ -438,20 +440,24 @@ install(TARGETS dfhack
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION}) RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION})
# install the offset file
install(FILES xml/symbols.xml
DESTINATION ${DFHACK_DATA_DESTINATION})
install(TARGETS dfhack-run dfhack-client binpatch install(TARGETS dfhack-run dfhack-client binpatch
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION} LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION}) RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION})
install(DIRECTORY lua/ add_subdirectory(xml)
DESTINATION ${DFHACK_LUA_DESTINATION}
FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY ${dfhack_SOURCE_DIR}/patches endif(BUILD_LIBRARY)
DESTINATION ${DFHACK_DATA_DESTINATION}
FILES_MATCHING PATTERN "*.dif")
add_subdirectory(xml) # install the offset file
if(INSTALL_DATA_FILES)
install(FILES xml/symbols.xml
DESTINATION ${DFHACK_DATA_DESTINATION})
install(DIRECTORY lua/
DESTINATION ${DFHACK_LUA_DESTINATION}
FILES_MATCHING PATTERN "*.lua")
install(DIRECTORY ${dfhack_SOURCE_DIR}/patches
DESTINATION ${DFHACK_DATA_DESTINATION}
FILES_MATCHING PATTERN "*.dif")
endif()

@ -24,15 +24,17 @@ if(BUILD_DEV_PLUGINS)
#add_subdirectory(devel) #add_subdirectory(devel)
endif() endif()
install(DIRECTORY lua/ if(INSTALL_DATA_FILES)
DESTINATION ${DFHACK_LUA_DESTINATION}/plugins install(DIRECTORY lua/
FILES_MATCHING PATTERN "*.lua") DESTINATION ${DFHACK_LUA_DESTINATION}/plugins
install(DIRECTORY raw/ FILES_MATCHING PATTERN "*.lua")
DESTINATION ${DFHACK_DATA_DESTINATION}/raw install(DIRECTORY raw/
FILES_MATCHING PATTERN "*.txt") DESTINATION ${DFHACK_DATA_DESTINATION}/raw
install(DIRECTORY raw/ FILES_MATCHING PATTERN "*.txt")
DESTINATION ${DFHACK_DATA_DESTINATION}/raw install(DIRECTORY raw/
FILES_MATCHING PATTERN "*.diff") DESTINATION ${DFHACK_DATA_DESTINATION}/raw
FILES_MATCHING PATTERN "*.diff")
endif()
# Protobuf # Protobuf
file(GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/proto/*.proto) file(GLOB PROJECT_PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/proto/*.proto)

@ -1 +1 @@
Subproject commit 808ac3b775ecafca512d583daead9bd1fc567855 Subproject commit f9fce95fd74bf1d5050e891dbd3e0bda2e8a7ce9