diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index d7bded0..99443ff 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -2,7 +2,6 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") ## Glad if(NOT TARGET glad) - add_subdirectory(glad) endif() ## GLFW @@ -11,25 +10,20 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) - add_subdirectory(glfw) + find_package(glfw3 REQUIRED) endif() endif() ## glm if(NOT TARGET glm::glm) - add_subdirectory(glm) - target_compile_definitions(glm INTERFACE GLM_ENABLE_EXPERIMENTAL) - set_target_properties(glm PROPERTIES LINKER_LANGUAGE CXX) endif() ## Imgui if(NOT TARGET imgui) - add_subdirectory(imgui) endif() ## Json if(NOT TARGET nlohmann_json::nlohmann_json) - add_subdirectory(json) endif() ## MarchingCube @@ -39,5 +33,5 @@ endif() ## stb if(NOT TARGET stb) - add_subdirectory(stb) + add_library(stb OBJECT stb_impl.cpp) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d03d96..205e566 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,7 +49,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}") # Link settings list(APPEND BACKEND_LIBS - glfw + ${GLFW_LIBRARIES} ) if(APPLE) @@ -371,5 +371,6 @@ add_definitions(-DNOMINMAX) target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include") # Link settings -target_link_libraries(polyscope PUBLIC imgui glm::glm) -target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb nlohmann_json::nlohmann_json MarchingCube::MarchingCube) +target_compile_definitions(polyscope PUBLIC GLM_ENABLE_EXPERIMENTAL) +target_link_libraries(polyscope PUBLIC imgui) +target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb MarchingCube::MarchingCube)