mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-02-04 15:06:57 +07:00
cmake fetch content instead git submodules for glew, glfw and assimp
This commit is contained in:
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -7,12 +7,6 @@
|
|||||||
[submodule "modules/utfcpp"]
|
[submodule "modules/utfcpp"]
|
||||||
path = modules/utfcpp
|
path = modules/utfcpp
|
||||||
url = https://github.com/nemtrif/utfcpp
|
url = https://github.com/nemtrif/utfcpp
|
||||||
[submodule "modules/glfw"]
|
|
||||||
path = modules/glfw
|
|
||||||
url = https://github.com/glfw/glfw
|
|
||||||
[submodule "modules/glew"]
|
|
||||||
path = modules/glew
|
|
||||||
url = https://github.com/Perlmint/glew-cmake
|
|
||||||
[submodule "modules/variant"]
|
[submodule "modules/variant"]
|
||||||
path = modules/variant
|
path = modules/variant
|
||||||
url = https://github.com/mpark/variant
|
url = https://github.com/mpark/variant
|
||||||
|
|||||||
@@ -91,15 +91,50 @@ if(APPLE)
|
|||||||
find_library(Foundation Foundation)
|
find_library(Foundation Foundation)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
#
|
||||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
# fetch 3rd party
|
||||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
#
|
||||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
||||||
add_subdirectory(modules/glfw)
|
|
||||||
|
|
||||||
set(glew-cmake_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
include(FetchContent)
|
||||||
set(glew-cmake_BUILD_MULTI_CONTEXT OFF CACHE BOOL "" FORCE)
|
|
||||||
add_subdirectory(modules/glew)
|
FetchContent_Declare(
|
||||||
|
assimp
|
||||||
|
GIT_REPOSITORY https://github.com/assimp/assimp)
|
||||||
|
FetchContent_Declare(
|
||||||
|
glew
|
||||||
|
GIT_REPOSITORY https://github.com/Perlmint/glew-cmake)
|
||||||
|
FetchContent_Declare(
|
||||||
|
glfw
|
||||||
|
GIT_REPOSITORY https://github.com/glfw/glfw)
|
||||||
|
|
||||||
|
FetchContent_GetProperties(assimp)
|
||||||
|
FetchContent_GetProperties(glew)
|
||||||
|
FetchContent_GetProperties(glfw)
|
||||||
|
|
||||||
|
if(NOT assimp_POPULATED)
|
||||||
|
FetchContent_Populate(assimp)
|
||||||
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(ASSIMP_NO_EXPORT ON CACHE BOOL "" FORCE)
|
||||||
|
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "" FORCE)
|
||||||
|
add_subdirectory(${assimp_SOURCE_DIR} ${assimp_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT glew_POPULATED)
|
||||||
|
FetchContent_Populate(glew)
|
||||||
|
set(glew-cmake_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
||||||
|
set(glew-cmake_BUILD_MULTI_CONTEXT OFF CACHE BOOL "" FORCE)
|
||||||
|
add_subdirectory(${glew_SOURCE_DIR} ${glew_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT glfw_POPULATED)
|
||||||
|
FetchContent_Populate(glfw)
|
||||||
|
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
add_subdirectory(${glfw_SOURCE_DIR} ${glfw_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
# e2d library target
|
# e2d library target
|
||||||
@@ -118,9 +153,10 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES
|
|||||||
target_include_directories(${PROJECT_NAME}
|
target_include_directories(${PROJECT_NAME}
|
||||||
PRIVATE headers
|
PRIVATE headers
|
||||||
PRIVATE sources
|
PRIVATE sources
|
||||||
PRIVATE modules/glew/include
|
PRIVATE ${assimp_SOURCE_DIR}/include
|
||||||
PRIVATE modules/glfw/include
|
PRIVATE ${assimp_BINARY_DIR}/include
|
||||||
PRIVATE ${OPENGL_INCLUDE_DIR})
|
PRIVATE ${glew_SOURCE_DIR}/include
|
||||||
|
PRIVATE ${glfw_SOURCE_DIR}/include)
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
CXX_STANDARD 14
|
CXX_STANDARD 14
|
||||||
|
|||||||
Submodule modules/glew deleted from 6dbc940772
Submodule modules/glfw deleted from 53c8c72c67
Reference in New Issue
Block a user