mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 10:37:17 -07:00
Move to cmake across all platforms (#363)
This commit is contained in:
parent
93d0d7443a
commit
1ebca42f46
63 changed files with 5852 additions and 8906 deletions
65
OTRGui/CMake/Default.cmake
Normal file
65
OTRGui/CMake/Default.cmake
Normal file
|
@ -0,0 +1,65 @@
|
|||
################################################################################
|
||||
# Command for variable_watch. This command issues error message, if a variable
|
||||
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
|
||||
# variable_watch(<variable> property_reader_guard)
|
||||
################################################################################
|
||||
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
|
||||
if("${PROPERTY_READER_GUARD_DISABLED}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
|
||||
message(FATAL_ERROR
|
||||
" Variable ${VARIABLE} is not supposed to be changed.\n"
|
||||
" It is used only for reading target property ${VARIABLE}.\n"
|
||||
" Use\n"
|
||||
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
|
||||
" or\n"
|
||||
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
|
||||
" instead.\n")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
# Create variable <name> with generator expression that expands to value of
|
||||
# target property <name>_<CONFIG>. If property is empty or not set then property
|
||||
# <name> is used instead. Variable <name> has watcher property_reader_guard that
|
||||
# doesn't allow to edit it.
|
||||
# create_property_reader(<name>)
|
||||
# Input:
|
||||
# name - Name of watched property and output variable
|
||||
################################################################################
|
||||
function(create_property_reader NAME)
|
||||
set(PROPERTY_READER_GUARD_DISABLED TRUE)
|
||||
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
|
||||
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
|
||||
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
|
||||
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
|
||||
variable_watch("${NAME}" property_reader_guard)
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
|
||||
# set_config_specific_property(<name> <value>)
|
||||
# Input:
|
||||
# name - Prefix of property name
|
||||
# value - New value
|
||||
################################################################################
|
||||
function(set_config_specific_property NAME VALUE)
|
||||
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
|
||||
create_property_reader("TARGET_NAME")
|
||||
create_property_reader("OUTPUT_DIRECTORY")
|
||||
|
||||
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
|
||||
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
|
||||
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
|
||||
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
|
||||
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
|
||||
|
||||
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
||||
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
|
12
OTRGui/CMake/DefaultCXX.cmake
Normal file
12
OTRGui/CMake/DefaultCXX.cmake
Normal file
|
@ -0,0 +1,12 @@
|
|||
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
|
||||
|
||||
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
|
||||
|
||||
if(MSVC)
|
||||
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
|
||||
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
|
||||
|
||||
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
||||
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
||||
endif()
|
234
OTRGui/CMake/Utils.cmake
Normal file
234
OTRGui/CMake/Utils.cmake
Normal file
|
@ -0,0 +1,234 @@
|
|||
# utils file for projects came from visual studio solution with cmake-converter.
|
||||
|
||||
################################################################################
|
||||
# Wrap each token of the command with condition
|
||||
################################################################################
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
macro(prepare_commands)
|
||||
unset(TOKEN_ROLE)
|
||||
unset(COMMANDS)
|
||||
foreach(TOKEN ${ARG_COMMANDS})
|
||||
if("${TOKEN}" STREQUAL "COMMAND")
|
||||
set(TOKEN_ROLE "KEYWORD")
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||
set(TOKEN_ROLE "CONDITION")
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||
set(TOKEN_ROLE "COMMAND")
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||
set(TOKEN_ROLE "ARG")
|
||||
endif()
|
||||
|
||||
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
|
||||
list(APPEND COMMANDS "${TOKEN}")
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
|
||||
set(CONDITION ${TOKEN})
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
|
||||
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
|
||||
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
|
||||
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
cmake_policy(POP)
|
||||
|
||||
################################################################################
|
||||
# Transform all the tokens to absolute paths
|
||||
################################################################################
|
||||
macro(prepare_output)
|
||||
unset(OUTPUT)
|
||||
foreach(TOKEN ${ARG_OUTPUT})
|
||||
if(IS_ABSOLUTE ${TOKEN})
|
||||
list(APPEND OUTPUT "${TOKEN}")
|
||||
else()
|
||||
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
################################################################################
|
||||
# Parse add_custom_command_if args.
|
||||
#
|
||||
# Input:
|
||||
# PRE_BUILD - Pre build event option
|
||||
# PRE_LINK - Pre link event option
|
||||
# POST_BUILD - Post build event option
|
||||
# TARGET - Target
|
||||
# OUTPUT - List of output files
|
||||
# DEPENDS - List of files on which the command depends
|
||||
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
|
||||
# condition2 commannd2 args2 ...)
|
||||
# Output:
|
||||
# OUTPUT - Output files
|
||||
# DEPENDS - Files on which the command depends
|
||||
# COMMENT - Comment
|
||||
# PRE_BUILD - TRUE/FALSE
|
||||
# PRE_LINK - TRUE/FALSE
|
||||
# POST_BUILD - TRUE/FALSE
|
||||
# TARGET - Target name
|
||||
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
|
||||
# NAME - Unique name for custom target
|
||||
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
|
||||
################################################################################
|
||||
function(add_custom_command_if_parse_arguments)
|
||||
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
|
||||
|
||||
if(WIN32)
|
||||
set(DUMMY "cd.")
|
||||
elseif(UNIX)
|
||||
set(DUMMY "true")
|
||||
endif()
|
||||
|
||||
prepare_commands()
|
||||
prepare_output()
|
||||
|
||||
set(DEPENDS "${ARG_DEPENDS}")
|
||||
set(COMMENT "${ARG_COMMENT}")
|
||||
set(PRE_BUILD "${ARG_PRE_BUILD}")
|
||||
set(PRE_LINK "${ARG_PRE_LINK}")
|
||||
set(POST_BUILD "${ARG_POST_BUILD}")
|
||||
set(TARGET "${ARG_TARGET}")
|
||||
if(PRE_BUILD)
|
||||
set(STEP "PRE_BUILD")
|
||||
elseif(PRE_LINK)
|
||||
set(STEP "PRE_LINK")
|
||||
elseif(POST_BUILD)
|
||||
set(STEP "POST_BUILD")
|
||||
endif()
|
||||
set(NAME "${TARGET}_${STEP}")
|
||||
|
||||
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
|
||||
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
|
||||
set(COMMENT "${COMMENT}" PARENT_SCOPE)
|
||||
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
|
||||
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
|
||||
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
|
||||
set(TARGET "${TARGET}" PARENT_SCOPE)
|
||||
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
|
||||
set(STEP "${STEP}" PARENT_SCOPE)
|
||||
set(NAME "${NAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
# Add conditional custom command
|
||||
#
|
||||
# Generating Files
|
||||
# The first signature is for adding a custom command to produce an output:
|
||||
# add_custom_command_if(
|
||||
# <OUTPUT output1 [output2 ...]>
|
||||
# <COMMANDS>
|
||||
# <COMMAND condition command1 [args1...]>
|
||||
# [COMMAND condition command2 [args2...]]
|
||||
# [DEPENDS [depends...]]
|
||||
# [COMMENT comment]
|
||||
#
|
||||
# Build Events
|
||||
# add_custom_command_if(
|
||||
# <TARGET target>
|
||||
# <PRE_BUILD | PRE_LINK | POST_BUILD>
|
||||
# <COMMAND condition command1 [args1...]>
|
||||
# [COMMAND condition command2 [args2...]]
|
||||
# [COMMENT comment]
|
||||
#
|
||||
# Input:
|
||||
# output - Output files the command is expected to produce
|
||||
# condition - Generator expression for wrapping the command
|
||||
# command - Command-line(s) to execute at build time.
|
||||
# args - Command`s args
|
||||
# depends - Files on which the command depends
|
||||
# comment - Display the given message before the commands are executed at
|
||||
# build time.
|
||||
# PRE_BUILD - Run before any other rules are executed within the target
|
||||
# PRE_LINK - Run after sources have been compiled but before linking the
|
||||
# binary
|
||||
# POST_BUILD - Run after all other rules within the target have been
|
||||
# executed
|
||||
################################################################################
|
||||
function(add_custom_command_if)
|
||||
add_custom_command_if_parse_arguments(${ARGN})
|
||||
|
||||
if(OUTPUT AND TARGET)
|
||||
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
|
||||
endif()
|
||||
|
||||
if(OUTPUT)
|
||||
add_custom_command(OUTPUT ${OUTPUT}
|
||||
${COMMANDS}
|
||||
DEPENDS ${DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT ${COMMENT})
|
||||
elseif(TARGET)
|
||||
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||
add_custom_target(
|
||||
${NAME}
|
||||
${COMMANDS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT ${COMMENT})
|
||||
add_dependencies(${TARGET} ${NAME})
|
||||
else()
|
||||
add_custom_command(
|
||||
TARGET ${TARGET}
|
||||
${STEP}
|
||||
${COMMANDS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT ${COMMENT})
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
# Use props file for a target and configs
|
||||
# use_props(<target> <configs...> <props_file>)
|
||||
# Inside <props_file> there are following variables:
|
||||
# PROPS_TARGET - <target>
|
||||
# PROPS_CONFIG - One of <configs...>
|
||||
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
|
||||
# Input:
|
||||
# target - Target to apply props file
|
||||
# configs - Build configurations to apply props file
|
||||
# props_file - CMake script
|
||||
################################################################################
|
||||
macro(use_props TARGET CONFIGS PROPS_FILE)
|
||||
set(PROPS_TARGET "${TARGET}")
|
||||
foreach(PROPS_CONFIG ${CONFIGS})
|
||||
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
|
||||
|
||||
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
|
||||
include("${ABSOLUTE_PROPS_FILE}")
|
||||
else()
|
||||
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
################################################################################
|
||||
# Add compile options to source file
|
||||
# source_file_compile_options(<source_file> [compile_options...])
|
||||
# Input:
|
||||
# source_file - Source file
|
||||
# compile_options - Options to add to COMPILE_FLAGS property
|
||||
################################################################################
|
||||
function(source_file_compile_options SOURCE_FILE)
|
||||
if("${ARGC}" LESS_EQUAL "1")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
|
||||
|
||||
if(COMPILE_OPTIONS)
|
||||
list(APPEND COMPILE_OPTIONS ${ARGN})
|
||||
else()
|
||||
set(COMPILE_OPTIONS "${ARGN}")
|
||||
endif()
|
||||
|
||||
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
|
||||
endfunction()
|
||||
|
||||
################################################################################
|
||||
# Default properties of visual studio projects
|
||||
################################################################################
|
||||
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")
|
||||
set(DEFAULT_Fortran_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultFortran.cmake")
|
|
@ -3,27 +3,61 @@ project(OTRGui)
|
|||
|
||||
set(PLATFORM "Desktop")
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
||||
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
|
||||
set(APP_ICON_RESOURCE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/appicon.rc)
|
||||
|
||||
add_subdirectory(libs/raylib)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||
endif()
|
||||
|
||||
include(CMake/Utils.cmake)
|
||||
|
||||
add_subdirectory(libs/raylib EXCLUDE_FROM_ALL)
|
||||
|
||||
include_directories(src)
|
||||
include_directories(src/game)
|
||||
include_directories(include)
|
||||
|
||||
include_external_msproject(ZAPD ../../ZAPDTR/ZAPD/ZAPD.vcproj)
|
||||
include_external_msproject(ZAPDUtils ../../ZAPDTR/ZAPDUtils/ZAPDUtils.vcproj)
|
||||
include_external_msproject(libultraship ../../libultraship/libultraship/libultraship.vcproj)
|
||||
include_external_msproject(OTRExporter ../../OTRExporter/OTRExporter/OTRExporter.vcproj)
|
||||
if (NOT TARGET libultraship)
|
||||
add_subdirectory(../libultraship/libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
||||
endif()
|
||||
if (NOT TARGET ZAPD)
|
||||
add_subdirectory(../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
||||
endif()
|
||||
if (NOT TARGET ZAPDUtils)
|
||||
add_subdirectory(../ZAPDTR/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
|
||||
endif()
|
||||
if (NOT TARGET OTRExporter)
|
||||
add_subdirectory(../OTRExporter/OTRExporter ${CMAKE_BINARY_DIR}/OTRExporter)
|
||||
endif()
|
||||
if (NOT TARGET storm)
|
||||
add_subdirectory(../StormLib ${CMAKE_BINARY_DIR}/StormLib)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE HEADERS src/*.h)
|
||||
file(GLOB_RECURSE SOURCES src/*.cpp)
|
||||
file(GLOB_RECURSE C_SOURCES src/*.c)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCES} ${C_SOURCES} ${HEADERS} ${APP_ICON_RESOURCE_WINDOWS})
|
||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/../OTRExporter/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/game" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
||||
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/../soh/assets/xml" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake")
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
|
||||
endif()
|
||||
|
||||
add_custom_target(Assets ALL
|
||||
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../OTRExporter/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/game" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../soh/assets/xml" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
|
||||
)
|
||||
|
||||
add_dependencies(OTRGui Assets)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC raylib)
|
||||
|
||||
INSTALL(TARGETS OTRGui DESTINATION . COMPONENT ship)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/assets
|
||||
DESTINATION .
|
||||
COMPONENT ship
|
||||
)
|
||||
INSTALL(TARGETS ZAPD DESTINATION assets/extractor COMPONENT ship)
|
||||
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
file(GLOB_RECURSE _file_list RELATIVE "${src_dir}" "${src_dir}/*")
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
string(REPLACE "\\ " " " sources_dir "${src_dir}")
|
||||
string(REPLACE "\\ " " " destination_dir "${dst_dir}")
|
||||
|
||||
file(GLOB_RECURSE _file_list RELATIVE "${sources_dir}" "${sources_dir}/*")
|
||||
|
||||
foreach( each_file ${_file_list} )
|
||||
set(destinationfile "${dst_dir}/${each_file}")
|
||||
set(sourcefile "${src_dir}/${each_file}")
|
||||
set(destinationfile "${destination_dir}/${each_file}")
|
||||
set(sourcefile "${sources_dir}/${each_file}")
|
||||
if(NOT EXISTS ${destinationfile} OR ${sourcefile} IS_NEWER_THAN ${destinationfile})
|
||||
get_filename_component(destinationdir ${destinationfile} DIRECTORY)
|
||||
file(COPY ${sourcefile} DESTINATION ${destinationdir})
|
||||
endif()
|
||||
endforeach(each_file)
|
||||
endforeach(each_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue