deps.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
  2. index 3b61d1e..714d247 100644
  3. --- a/deps/CMakeLists.txt
  4. +++ b/deps/CMakeLists.txt
  5. @@ -1,23 +1,21 @@
  6. if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
  7. ## Glad
  8. - add_subdirectory(glad)
  9. ## GLFW
  10. set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
  11. set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
  12. set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
  13. set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
  14. - add_subdirectory(glfw)
  15. + find_package(glfw3 REQUIRED)
  16. endif()
  17. if("${POLYSCOPE_BACKEND_OPENGL_MOCK}")
  18. endif()
  19. ## Imgui
  20. -add_subdirectory(imgui)
  21. ## Argparse
  22. ## Other dependencies
  23. -add_subdirectory(stb)
  24. +add_library(stb OBJECT stb_impl.cpp)
  25. diff --git a/deps/MarchingCubeCpp/include/MarchingCube/MC.h b/deps/MarchingCubeCpp/include/MarchingCube/MC.h
  26. index 62e6c37..e2d204b 100644
  27. --- a/deps/MarchingCubeCpp/include/MarchingCube/MC.h
  28. +++ b/deps/MarchingCubeCpp/include/MarchingCube/MC.h
  29. @@ -5,8 +5,10 @@
  30. #include <cmath>
  31. // Added by nsharp: use glm instead of internal vector class
  32. +#define GLM_ENABLE_EXPERIMENTAL
  33. #include <glm/glm.hpp>
  34. #include <glm/gtx/norm.hpp>
  35. +#undef GLM_ENABLE_EXPERIMENTAL
  36. namespace MC
  37. {
  38. diff --git a/examples/demo-app/demo_app.cpp b/examples/demo-app/demo_app.cpp
  39. index 8af2b5a..a8be07c 100644
  40. --- a/examples/demo-app/demo_app.cpp
  41. +++ b/examples/demo-app/demo_app.cpp
  42. @@ -24,7 +24,7 @@
  43. #include "args/args.hxx"
  44. #include "happly.h"
  45. -#include "json/json.hpp"
  46. +#include "nlohmann/json.hpp"
  47. #include "simple_dot_mesh_parser.h"
  48. #include "surface_mesh_io.h"
  49. diff --git a/include/polyscope/internal.h b/include/polyscope/internal.h
  50. index d339e77..c875248 100644
  51. --- a/include/polyscope/internal.h
  52. +++ b/include/polyscope/internal.h
  53. @@ -2,6 +2,7 @@
  54. #pragma once
  55. +#include <cstdint>
  56. #include <string>
  57. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  58. index 77e6dbd..3b2d98c 100644
  59. --- a/src/CMakeLists.txt
  60. +++ b/src/CMakeLists.txt
  61. @@ -48,7 +48,7 @@ if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")
  62. # Link settings
  63. list(APPEND BACKEND_LIBS
  64. - glfw ${GLFW_LIBRARIES}
  65. + ${GLFW_LIBRARIES}
  66. )
  67. if(APPLE)
  68. @@ -330,15 +330,9 @@ add_definitions(-DNOMINMAX)
  69. # Include settings
  70. target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
  71. -target_include_directories(polyscope PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../deps/glm")
  72. -#target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/args") # not used, polyscope generates no apps directly
  73. -target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/happly")
  74. -target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/MarchingCubeCpp")
  75. -target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/json/include")
  76. -target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/stb")
  77. target_include_directories(polyscope PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../deps/MarchingCubeCpp/include")
  78. -target_include_directories(polyscope PRIVATE "${BACKEND_INCLUDE_DIRS}")
  79. # Link settings
  80. target_link_libraries(polyscope PUBLIC imgui)
  81. target_link_libraries(polyscope PRIVATE "${BACKEND_LIBS}" stb)
  82. +install(TARGETS polyscope LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin)
  83. diff --git a/src/polyscope.cpp b/src/polyscope.cpp
  84. index 914d587..f4ccf92 100644
  85. --- a/src/polyscope.cpp
  86. +++ b/src/polyscope.cpp
  87. @@ -16,7 +16,7 @@
  88. #include "stb_image.h"
  89. -#include "json/json.hpp"
  90. +#include "nlohmann/json.hpp"
  91. using json = nlohmann::json;
  92. #include "backends/imgui_impl_opengl3.h"
  93. diff --git a/src/transformation_gizmo.cpp b/src/transformation_gizmo.cpp
  94. index 25c25f8..36fedfd 100644
  95. --- a/src/transformation_gizmo.cpp
  96. +++ b/src/transformation_gizmo.cpp
  97. @@ -4,8 +4,10 @@
  98. #include "polyscope/polyscope.h"
  99. +#define GLM_ENABLE_EXPERIMENTAL
  100. #include <glm/gtc/matrix_transform.hpp>
  101. #include <glm/gtx/transform.hpp>
  102. +#undef GLM_ENABLE_EXPERIMENTAL
  103. #include <cmath>
  104. diff --git a/src/view.cpp b/src/view.cpp
  105. index 5d3c60b..dd03ef0 100644
  106. --- a/src/view.cpp
  107. +++ b/src/view.cpp
  108. @@ -7,7 +7,7 @@
  109. #include "imgui.h"
  110. -#include "json/json.hpp"
  111. +#include "nlohmann/json.hpp"
  112. using json = nlohmann::json;
  113. namespace polyscope {