Skip to content

Commit 85b4322

Browse files
committedJun 21, 2023
minor cleanup of cmakelists
1 parent 7a570c8 commit 85b4322

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed
 

‎CMakeLists.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
cmake_minimum_required(VERSION 3.6)
22

3-
PROJECT (tinygltf)
3+
project(tinygltf)
44

55
include(GNUInstallDirs)
66
include(CMakePackageConfigHelpers)
77

8-
SET(CMAKE_CXX_STANDARD 11)
8+
set(CMAKE_CXX_STANDARD 11)
9+
set(CMAKE_CXX_STANDARD_REQUIRED On)
10+
set(CMAKE_CXX_EXTENSIONS Off)
11+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
912

1013
option(TINYGLTF_BUILD_LOADER_EXAMPLE "Build loader_example(load glTF and dump infos)" ON)
1114
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(
1518
option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set to OFF if you include tinygltf through add_subdirectory()" ON)
1619

1720
if (TINYGLTF_BUILD_LOADER_EXAMPLE)
18-
ADD_EXECUTABLE ( loader_example
21+
add_executable(loader_example
1922
loader_example.cc
2023
)
2124
endif (TINYGLTF_BUILD_LOADER_EXAMPLE)
2225

2326
if (TINYGLTF_BUILD_GL_EXAMPLES)
24-
ADD_SUBDIRECTORY ( examples/gltfutil )
25-
ADD_SUBDIRECTORY ( examples/glview )
27+
add_subdirectory( examples/gltfutil )
28+
add_subdirectory( examples/glview )
2629
endif (TINYGLTF_BUILD_GL_EXAMPLES)
2730

2831
if (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
29-
ADD_SUBDIRECTORY ( examples/validator )
32+
add_subdirectory( examples/validator )
3033
endif (TINYGLTF_BUILD_VALIDATOR_EXAMPLE)
3134

3235
if (TINYGLTF_BUILD_BUILDER_EXAMPLE)
33-
ADD_SUBDIRECTORY ( examples/build-gltf )
36+
add_subdirectory ( examples/build-gltf )
3437
endif (TINYGLTF_BUILD_BUILDER_EXAMPLE)
3538

3639
#

‎examples/build-gltf/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
include_directories(${CMAKE_SOURCE_DIR})
3+
add_executable(create_triangle_gltf create_triangle_gltf.cpp)
4+
target_compile_options(create_triangle_gltf PUBLIC -Wall)
5+
target_link_libraries(create_triangle_gltf )

0 commit comments

Comments
 (0)
Please sign in to comment.