diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index ba307501b1..a374149121 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -27,6 +27,8 @@ link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) link_hifi_library(voxel-server-library ${TARGET_NAME} ${ROOT_DIR}) +include_directories(${ROOT_DIR}/externals/civetweb/include) + # link the stk library set(STK_ROOT_DIR ${ROOT_DIR}/externals/stk) find_package(STK REQUIRED) diff --git a/cmake/macros/SetupHifiLibrary.cmake b/cmake/macros/SetupHifiLibrary.cmake index 79bf16e1a0..217be6b3a0 100644 --- a/cmake/macros/SetupHifiLibrary.cmake +++ b/cmake/macros/SetupHifiLibrary.cmake @@ -6,7 +6,7 @@ MACRO(SETUP_HIFI_LIBRARY TARGET) set(LIB_SRCS ${LIB_SRCS} ${WRAPPED_SRCS}) # create a library and set the property so it can be referenced later - add_library(${TARGET} ${LIB_SRCS}) + add_library(${TARGET} ${LIB_SRCS} ${ARGN}) find_package(Qt5Core REQUIRED) qt5_use_modules(${TARGET} Core) diff --git a/domain-server/CMakeLists.txt b/domain-server/CMakeLists.txt index 92fa090150..46319819b6 100644 --- a/domain-server/CMakeLists.txt +++ b/domain-server/CMakeLists.txt @@ -8,11 +8,11 @@ set(TARGET_NAME domain-server) include(${MACRO_DIR}/SetupHifiProject.cmake) # grab cJSON and civetweb sources to pass as OPTIONAL_SRCS -FILE(GLOB OPTIONAL_SRCS external/civetweb/src/* external/cJSON/src/*) +FILE(GLOB OPTIONAL_SRCS ${ROOT_DIR}/externals/civetweb/src/* external/cJSON/src/*) setup_hifi_project(${TARGET_NAME} TRUE ${OPTIONAL_SRCS}) -include_directories(external/civetweb/include external/cJSON/include) +include_directories(${ROOT_DIR}/externals/civetweb/include external/cJSON/include) # remove and then copy the files for the webserver add_custom_command(TARGET ${TARGET_NAME} POST_BUILD diff --git a/domain-server/external/civetweb/LICENSE.md b/externals/civetweb/LICENSE.md similarity index 100% rename from domain-server/external/civetweb/LICENSE.md rename to externals/civetweb/LICENSE.md diff --git a/domain-server/external/civetweb/include/civetweb.h b/externals/civetweb/include/civetweb.h similarity index 100% rename from domain-server/external/civetweb/include/civetweb.h rename to externals/civetweb/include/civetweb.h diff --git a/domain-server/external/civetweb/include/md5.inl b/externals/civetweb/include/md5.inl similarity index 100% rename from domain-server/external/civetweb/include/md5.inl rename to externals/civetweb/include/md5.inl diff --git a/domain-server/external/civetweb/src/civetweb.c b/externals/civetweb/src/civetweb.c similarity index 100% rename from domain-server/external/civetweb/src/civetweb.c rename to externals/civetweb/src/civetweb.c diff --git a/libraries/voxel-server-library/CMakeLists.txt b/libraries/voxel-server-library/CMakeLists.txt index 1298ef1bae..2239731f3c 100644 --- a/libraries/voxel-server-library/CMakeLists.txt +++ b/libraries/voxel-server-library/CMakeLists.txt @@ -11,18 +11,19 @@ set(TARGET_NAME voxel-server-library) find_package(Qt5Widgets REQUIRED) include(${MACRO_DIR}/SetupHifiLibrary.cmake) -setup_hifi_library(${TARGET_NAME}) + +# grab cJSON and civetweb sources to pass as OPTIONAL_SRCS +FILE(GLOB OPTIONAL_SRCS ${ROOT_DIR}/externals/civetweb/src/*) + +setup_hifi_library(${TARGET_NAME} ${OPTIONAL_SRCS}) + +include_directories(${ROOT_DIR}/externals/civetweb/include) qt5_use_modules(${TARGET_NAME} Widgets) include(${MACRO_DIR}/IncludeGLM.cmake) include_glm(${TARGET_NAME} ${ROOT_DIR}) -# setup a library for civetweb and link it to the voxel-server-library -# this assumes that the domain-server cmake has already correctly set up the civetweb library -include_directories(../../domain-server/external/civetweb/include) -target_link_libraries(${TARGET_NAME} civetweb) - include(${MACRO_DIR}/LinkHifiLibrary.cmake) link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) diff --git a/libraries/voxel-server-library/src/VoxelServer.h b/libraries/voxel-server-library/src/VoxelServer.h index a52abaec07..282943e28d 100644 --- a/libraries/voxel-server-library/src/VoxelServer.h +++ b/libraries/voxel-server-library/src/VoxelServer.h @@ -10,14 +10,14 @@ #ifndef __voxel_server__VoxelServer__ #define __voxel_server__VoxelServer__ -#include "../../domain-server/external/civetweb/include/civetweb.h" - #include #include #include #include +#include "civetweb.h" + #include "NodeWatcher.h" #include "VoxelPersistThread.h" #include "VoxelSendThread.h"