From 13f2ea33ad61d0d87a315f42aaa03869189b38dd Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 26 Sep 2014 08:48:00 -0700 Subject: [PATCH] symlink the web directory instead of direct copy for DS --- domain-server/CMakeLists.txt | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/domain-server/CMakeLists.txt b/domain-server/CMakeLists.txt index d4e45e0204..8513e1df26 100644 --- a/domain-server/CMakeLists.txt +++ b/domain-server/CMakeLists.txt @@ -3,14 +3,32 @@ set(TARGET_NAME domain-server) # setup the project and link required Qt modules setup_hifi_project(Network) -# remove and then copy the files for the webserver -add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E remove_directory - $/resources) -add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/resources" - $/resources) +# remove current resources dir +add_custom_command( + TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E remove_directory + $/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" + $/resources +) +# 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 + $/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" + $/resources/web +) # link the shared hifi libraries link_hifi_libraries(embedded-webserver networking shared)