mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
add a macro for directory copying
This commit is contained in:
parent
17142a532f
commit
38ae3afc82
2 changed files with 16 additions and 32 deletions
|
@ -34,4 +34,4 @@ macro(SETUP_HIFI_PROJECT)
|
||||||
foreach(QT_MODULE ${${TARGET_NAME}_DEPENDENCY_QT_MODULES})
|
foreach(QT_MODULE ${${TARGET_NAME}_DEPENDENCY_QT_MODULES})
|
||||||
target_link_libraries(${TARGET_NAME} Qt5::${QT_MODULE})
|
target_link_libraries(${TARGET_NAME} Qt5::${QT_MODULE})
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -3,38 +3,22 @@ set(TARGET_NAME domain-server)
|
||||||
# setup the project and link required Qt modules
|
# setup the project and link required Qt modules
|
||||||
setup_hifi_project(Network)
|
setup_hifi_project(Network)
|
||||||
|
|
||||||
# remove current resources dir
|
if (UPPER_CMAKE_BUILD_TYPE MATCHES DEBUG AND NOT WIN32)
|
||||||
add_custom_command(
|
set(SHOULD_SYMLINK_RESOURCES FALSE)
|
||||||
TARGET ${TARGET_NAME} POST_BUILD
|
else ()
|
||||||
COMMAND "${CMAKE_COMMAND}" -E remove_directory
|
set(SHOULD_SYMLINK_RESOURCES FALSE)
|
||||||
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources
|
|
||||||
)
|
|
||||||
# copy all files in resources, including web
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${TARGET_NAME} POST_BUILD
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
|
||||||
"${PROJECT_SOURCE_DIR}/resources"
|
|
||||||
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT WIN32)
|
|
||||||
# remove the web directory so we can make it a symlink
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${TARGET_NAME} POST_BUILD
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E remove_directory
|
|
||||||
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/web
|
|
||||||
)
|
|
||||||
|
|
||||||
# make the web directory a symlink
|
|
||||||
add_custom_command(
|
|
||||||
TARGET ${TARGET_NAME} POST_BUILD
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E create_symlink
|
|
||||||
"${PROJECT_SOURCE_DIR}/resources/web"
|
|
||||||
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/web
|
|
||||||
)
|
|
||||||
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
copy_directory_beside_target(${SHOULD_SYMLINK_RESOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/resources" "resources")
|
||||||
|
|
||||||
|
# copy all files in resources, including web
|
||||||
|
# add_custom_command(
|
||||||
|
# TARGET ${TARGET_NAME} POST_BUILD
|
||||||
|
# COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
|
# "${PROJECT_SOURCE_DIR}/resources"
|
||||||
|
# $<TARGET_FILE_DIR:${TARGET_NAME}>/resources
|
||||||
|
# )
|
||||||
|
|
||||||
# link the shared hifi libraries
|
# link the shared hifi libraries
|
||||||
link_hifi_libraries(embedded-webserver networking shared)
|
link_hifi_libraries(embedded-webserver networking shared)
|
||||||
|
|
||||||
|
@ -52,4 +36,4 @@ include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
|
||||||
# append OpenSSL to our list of libraries to link
|
# append OpenSSL to our list of libraries to link
|
||||||
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
copy_dlls_beside_windows_executable()
|
copy_dlls_beside_windows_executable()
|
||||||
|
|
Loading…
Reference in a new issue