mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-12 06:59:02 +08:00
minor cleanup of cmakelists
This commit is contained in:
parent
7a570c88d9
commit
85b4322ade
@ -1,11 +1,14 @@
|
|||||||
cmake_minimum_required(VERSION 3.6)
|
cmake_minimum_required(VERSION 3.6)
|
||||||
|
|
||||||
PROJECT (tinygltf)
|
project(tinygltf)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
SET(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED On)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS Off)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
option(TINYGLTF_BUILD_LOADER_EXAMPLE "Build loader_example(load glTF and dump infos)" ON)
|
option(TINYGLTF_BUILD_LOADER_EXAMPLE "Build loader_example(load glTF and dump infos)" ON)
|
||||||
option(TINYGLTF_BUILD_GL_EXAMPLES "Build GL exampels(requires glfw, OpenGL, etc)" OFF)
|
option(TINYGLTF_BUILD_GL_EXAMPLES "Build GL exampels(requires glfw, OpenGL, etc)" OFF)
|
||||||
@ -15,22 +18,22 @@ option(TINYGLTF_HEADER_ONLY "On: header-only mode. Off: create tinygltf library(
|
|||||||
option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set to OFF if you include tinygltf through add_subdirectory()" ON)
|
option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set to OFF if you include tinygltf through add_subdirectory()" ON)
|
||||||
|
|
||||||
if (TINYGLTF_BUILD_LOADER_EXAMPLE)
|
if (TINYGLTF_BUILD_LOADER_EXAMPLE)
|
||||||
ADD_EXECUTABLE ( loader_example
|
add_executable(loader_example
|
||||||
loader_example.cc
|
loader_example.cc
|
||||||
)
|
)
|
||||||
endif (TINYGLTF_BUILD_LOADER_EXAMPLE)
|
endif (TINYGLTF_BUILD_LOADER_EXAMPLE)
|
||||||
|
|
||||||
if (TINYGLTF_BUILD_GL_EXAMPLES)
|
if (TINYGLTF_BUILD_GL_EXAMPLES)
|
||||||
ADD_SUBDIRECTORY ( examples/gltfutil )
|
add_subdirectory( examples/gltfutil )
|
||||||
ADD_SUBDIRECTORY ( examples/glview )
|
add_subdirectory( examples/glview )
|
||||||
endif (TINYGLTF_BUILD_GL_EXAMPLES)
|
endif (TINYGLTF_BUILD_GL_EXAMPLES)
|
||||||
|
|
||||||
if (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
|
if (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
|
||||||
ADD_SUBDIRECTORY ( examples/validator )
|
add_subdirectory( examples/validator )
|
||||||
endif (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
|
endif (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
|
||||||
|
|
||||||
if (TINYGLTF_BUILD_BUILDER_EXAMPLE)
|
if (TINYGLTF_BUILD_BUILDER_EXAMPLE)
|
||||||
ADD_SUBDIRECTORY ( examples/build-gltf )
|
add_subdirectory ( examples/build-gltf )
|
||||||
endif (TINYGLTF_BUILD_BUILDER_EXAMPLE)
|
endif (TINYGLTF_BUILD_BUILDER_EXAMPLE)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
5
examples/build-gltf/CMakeLists.txt
Normal file
5
examples/build-gltf/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR})
|
||||||
|
add_executable(create_triangle_gltf create_triangle_gltf.cpp)
|
||||||
|
target_compile_options(create_triangle_gltf PUBLIC -Wall)
|
||||||
|
target_link_libraries(create_triangle_gltf )
|
Loading…
x
Reference in New Issue
Block a user