deps.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
  2. index d7bded0..99443ff 100644
  3. --- a/deps/CMakeLists.txt
  4. +++ b/deps/CMakeLists.txt
  5. @@ -2,7 +2,6 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
  6. ## Glad
  7. if(NOT TARGET glad)
  8. - add_subdirectory(glad)
  9. endif()
  10. ## GLFW
  11. @@ -11,25 +10,20 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
  12. set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
  13. set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
  14. set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
  15. - add_subdirectory(glfw)
  16. + find_package(glfw3 REQUIRED)
  17. endif()
  18. endif()
  19. ## glm
  20. if(NOT TARGET glm::glm)
  21. - add_subdirectory(glm)
  22. - target_compile_definitions(glm INTERFACE GLM_ENABLE_EXPERIMENTAL)
  23. - set_target_properties(glm PROPERTIES LINKER_LANGUAGE CXX)
  24. endif()
  25. ## Imgui
  26. if(NOT TARGET imgui)
  27. - add_subdirectory(imgui)
  28. endif()
  29. ## Json
  30. if(NOT TARGET nlohmann_json::nlohmann_json)
  31. - add_subdirectory(json)
  32. endif()
  33. ## MarchingCube
  34. @@ -39,5 +33,5 @@ endif()
  35. ## stb
  36. if(NOT TARGET stb)
  37. - add_subdirectory(stb)
  38. + add_library(stb OBJECT stb_impl.cpp)
  39. endif()
  40. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  41. index 9d03d96..205e566 100644
  42. --- a/src/CMakeLists.txt
  43. +++ b/src/CMakeLists.txt
  44. @@ -49,7 +49,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
  45. # Link settings
  46. list(APPEND BACKEND_LIBS
  47. - glfw
  48. + ${GLFW_LIBRARIES}
  49. )
  50. if(APPLE)
  51. @@ -371,5 +371,6 @@ add_definitions(-DNOMINMAX)
  52. target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
  53. # Link settings
  54. -target_link_libraries(polyscope PUBLIC imgui glm::glm)
  55. -target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb nlohmann_json::nlohmann_json MarchingCube::MarchingCube)
  56. +target_compile_definitions(polyscope PUBLIC GLM_ENABLE_EXPERIMENTAL)
  57. +target_link_libraries(polyscope PUBLIC imgui)
  58. +target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb MarchingCube::MarchingCube)