Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
prism/extern/CMakeLists.txt

129 lines
4.1 KiB
Text
Raw Permalink Normal View History

2020-08-11 12:07:21 -04:00
set(CMAKE_FOLDER "External")
include(FetchContent)
2020-08-11 12:07:21 -04:00
# cmake does not feel like fixing this terrible issue in fetchcontent, so we are going to fix it ourselves.
# solution located here: https://gitlab.kitware.com/cmake/cmake/-/issues/21146#note_933303
if(NOT WIN32)
set(BULLET_PATCH_COMMAND git apply -v --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/fix_bullet_cmake_version.patch || true)
endif()
2020-09-22 12:54:08 -04:00
FetchContent_Declare(
bullet
GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git
GIT_TAG fa50f195e6911d60c5ed888d5df33adb1736f93b # v3.21
PATCH_COMMAND ${BULLET_PATCH_COMMAND}
GIT_SHALLOW ON
2020-09-22 12:54:08 -04:00
)
FetchContent_Declare(
spirv-cross
GIT_REPOSITORY https://github.com/KhronosGroup/SPIRV-Cross.git
GIT_TAG 0e2880ab990e79ce6cc8c79c219feda42d98b1e8
GIT_SHALLOW ON
2020-09-22 12:54:08 -04:00
)
FetchContent_Declare(
glslang
GIT_REPOSITORY https://github.com/KhronosGroup/glslang.git
GIT_TAG main
GIT_SHALLOW ON
2020-09-22 12:54:08 -04:00
)
# bullet
set(BUILD_BULLET3 OFF CACHE BOOL "" FORCE)
set(BUILD_BULLET3_DEMOS OFF CACHE BOOL "" FORCE)
set(BUILD_BULLET2_DEMOS OFF CACHE BOOL "" FORCE)
set(BUILD_CPU_DEMOS OFF CACHE BOOL "" FORCE)
set(USE_GRAPHICAL_BENCHMARK OFF CACHE BOOL "" FORCE)
set(BUILD_EXTRAS OFF CACHE BOOL "" FORCE)
set(INSTALL_LIBS OFF CACHE BOOL "" FORCE)
# spirv-cross
set(BUILD_UNIT_TESTS OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_SKIP_INSTALL ON CACHE BOOL "" FORCE)
set(BUILD_EXTERNAL OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_CLI OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_HLSL ON CACHE BOOL "" FORCE)
2020-09-22 12:54:08 -04:00
set(SPIRV_CROSS_ENABLE_CPP OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_REFLECT OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_C_API OFF CACHE BOOL "" FORCE)
set(SPIRV_CROSS_ENABLE_UTIL OFF CACHE BOOL "" FORCE)
# glslang
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BUILD_EXTERNAL OFF CACHE BOOL "" FORCE)
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "" FORCE)
set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "" FORCE)
set(ENABLE_GLSLANG_INSTALL OFF CACHE BOOL "" FORCE)
set(ENABLE_CTEST OFF CACHE BOOL "" FORCE)
set(CMAKE_PROJECT_BULLET_PHYSICS_INCLUDE_BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/fix_bad_cmake_dev.cmake)
2020-09-22 12:54:08 -04:00
FetchContent_MakeAvailable(bullet)
FetchContent_MakeAvailable(spirv-cross)
FetchContent_MakeAvailable(glslang)
2020-08-11 12:07:21 -04:00
set(OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF CACHE BOOL "" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(stb)
add_subdirectory(imgui)
add_subdirectory(magic_enum)
add_subdirectory(smaa)
add_subdirectory(doctest)
FetchContent_Declare(
json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
GIT_TAG v3.11.2
GIT_SHALLOW TRUE)
2020-08-11 12:07:21 -04:00
FetchContent_GetProperties(json)
if (NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif ()
if (NOT ENABLE_IOS AND NOT ENABLE_TVOS)
add_subdirectory(ogg)
add_subdirectory(opus)
add_library(opusfile
opusfile/src/opusfile.c
opusfile/src/info.c
opusfile/src/internal.c
opusfile/src/stream.c)
target_include_directories(opusfile
PUBLIC
opusfile/include)
target_link_libraries(opusfile
PUBLIC
ogg
opus)
endif ()
if (BUILD_TOOLS)
set(ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(ASSIMP_NO_EXPORT ON CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ZLIB OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "" FORCE)
add_subdirectory(assimp)
endif ()
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG b6f4ceaed0a0a24ccf575fab6c56dd50ccf6f1a9
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(fmt)
if (ENABLE_METAL)
add_subdirectory(metal-cpp)
endif ()