submodules instead fetch content

This commit is contained in:
2018-12-05 17:07:54 +07:00
parent d853ea5af7
commit 8cd44f1e5b
6 changed files with 27 additions and 53 deletions

9
.gitmodules vendored
View File

@@ -16,3 +16,12 @@
[submodule "modules/rapidjson"]
path = modules/rapidjson
url = https://github.com/Tencent/rapidjson
[submodule "modules/glew"]
path = modules/glew
url = https://github.com/Perlmint/glew-cmake
[submodule "modules/glfw"]
path = modules/glfw
url = https://github.com/glfw/glfw
[submodule "toolset/model_converter/modules/assimp"]
path = toolset/model_converter/modules/assimp
url = https://github.com/assimp/assimp

View File

@@ -91,37 +91,15 @@ if(APPLE)
find_library(Foundation Foundation)
endif(APPLE)
#
# fetch 3rd party
#
set(glew-cmake_BUILD_SHARED OFF CACHE BOOL "" FORCE)
set(glew-cmake_BUILD_MULTI_CONTEXT OFF CACHE BOOL "" FORCE)
add_subdirectory(modules/glew)
include(FetchContent)
FetchContent_Declare(
glew
GIT_REPOSITORY https://github.com/Perlmint/glew-cmake)
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw)
FetchContent_GetProperties(glew)
FetchContent_GetProperties(glfw)
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()
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(modules/glfw)
#
# e2d library target
@@ -140,8 +118,8 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES
target_include_directories(${PROJECT_NAME}
PRIVATE headers
PRIVATE sources
PRIVATE ${glew_SOURCE_DIR}/include
PRIVATE ${glfw_SOURCE_DIR}/include)
PRIVATE modules/glew/include
PRIVATE modules/glfw/include)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14

1
modules/glew Submodule

Submodule modules/glew added at 6dbc940772

1
modules/glfw Submodule

Submodule modules/glfw added at f9923e9095

View File

@@ -1,23 +1,11 @@
#
# fetch 3rd party
# external 3rd party
#
include(FetchContent)
FetchContent_Declare(
assimp
GIT_REPOSITORY https://github.com/assimp/assimp)
FetchContent_GetProperties(assimp)
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()
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(modules/assimp)
#
# model converter executable
@@ -35,10 +23,6 @@ add_executable(model_converter
target_link_libraries(model_converter
assimp)
target_include_directories(model_converter
PRIVATE ${assimp_SOURCE_DIR}/include
PRIVATE ${assimp_BINARY_DIR}/include)
set_target_properties(model_converter PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES