Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake dependencies to rely on proper targets #261

Merged
merged 23 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
[submodule "deps/happly"]
path = deps/happly
url = https://github.com/nmwsharp/happly.git
[submodule "deps/glm"]
path = deps/glm
url = https://github.com/g-truc/glm.git
40 changes: 29 additions & 11 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
if("${POLYSCOPE_BACKEND_OPENGL3_GLFW}")

## Glad
add_subdirectory(glad)
if(NOT TARGET glad)
add_subdirectory(glad)
endif()

## GLFW
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
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)
if(NOT TARGET glfw)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
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)
endif()
endif()

if("${POLYSCOPE_BACKEND_OPENGL_MOCK}")
## glm
if(NOT TARGET glm::glm)
add_subdirectory(glm)
endif()

## Imgui
add_subdirectory(imgui)
if(NOT TARGET imgui)
add_subdirectory(imgui)
endif()

## Argparse
## Json
if(NOT TARGET nlohmann_json::nlohmann_json)
add_subdirectory(json)
endif()

## Other dependencies
add_subdirectory(stb)
## MarchingCube
if(NOT TARGET MarchingCube::MarchingCube)
add_subdirectory(MarchingCubeCpp)
endif()

## stb
if(NOT TARGET stb)
add_subdirectory(stb)
endif()
4 changes: 4 additions & 0 deletions deps/MarchingCubeCpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_library(MarchingCube INTERFACE)
add_library(MarchingCube::MarchingCube ALIAS MarchingCube)

target_include_directories(MarchingCube INTERFACE include)
2 changes: 1 addition & 1 deletion deps/glad/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ if (library_type STREQUAL SHARED_LIBRARY)
target_compile_definitions(glad PUBLIC GLAD_GLAPI_EXPORT PRIVATE GLAD_GLAPI_EXPORT_BUILD)
endif()

target_include_directories(glad PRIVATE "../include")
target_include_directories(glad PUBLIC "../include")

set_target_properties(glad PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
1 change: 1 addition & 0 deletions deps/glm
Submodule glm added at bf71a8
239 changes: 0 additions & 239 deletions deps/glm/CMakeLists.txt

This file was deleted.

54 changes: 0 additions & 54 deletions deps/glm/copying.txt

This file was deleted.

Loading