From f20888ae8bf0f0cc090b67394453dd8d93c6b780 Mon Sep 17 00:00:00 2001 From: Tan Meng Yue Date: Wed, 5 Dec 2018 23:55:53 +1100 Subject: [PATCH 1/3] Added top level CMake configuration file --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..db30ecf --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.6) + +PROJECT (tinygltf) + +SET(CMAKE_CXX_STANDARD 11) + +ADD_EXECUTABLE ( loader_example + loader_example.cc + ) + +ADD_SUBDIRECTORY ( examples/gltfutil ) +ADD_SUBDIRECTORY ( examples/glview ) +ADD_SUBDIRECTORY ( examples/validator ) From 2dcf79566f19e99ee3365de5c8b435d7a3b775e9 Mon Sep 17 00:00:00 2001 From: Tan Meng Yue Date: Wed, 5 Dec 2018 23:56:23 +1100 Subject: [PATCH 2/3] Add CMake configuration for glview So that we can build more of the examples consistently with CMake --- examples/glview/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 examples/glview/CMakeLists.txt diff --git a/examples/glview/CMakeLists.txt b/examples/glview/CMakeLists.txt new file mode 100644 index 0000000..4d40557 --- /dev/null +++ b/examples/glview/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.6) +project(glview) + +find_package ( GLEW REQUIRED ) +find_package ( OpenGL REQUIRED ) + +find_library(COCOA_LIBRARY Cocoa) +find_library(COREVIDEO_LIBRARY CoreVideo) +find_library(IOKIT_LIBRARY IOKit) + +set(CMAKE_CXX_STANDARD 11) + +include_directories( + ../../ + ../common + # ${OPENGL_INCLUDE_DIR} + ${GLEW_INCLUDE_DIR} + ${GLFW_INCLUDE_DIR} + ) + +add_executable(glview + glview.cc + ../common/trackball.cc + ) + +target_link_libraries ( glview + ${GLEW_LIBRARY} + ${GLFW_LIBRARY} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + ${COCOA_LIBRARY} + ${COREVIDEO_LIBRARY} + ${IOKIT_LIBRARY} + ) From 94fcfdeb9dbd8556a3997bc8a08a267af9507f79 Mon Sep 17 00:00:00 2001 From: Tan Meng Yue Date: Fri, 7 Dec 2018 18:01:08 +1100 Subject: [PATCH 3/3] Added installation of headers and target binaries --- CMakeLists.txt | 9 +++++++++ examples/gltfutil/CMakeLists.txt | 6 ++++++ examples/glview/CMakeLists.txt | 6 ++++++ examples/validator/CMakeLists.txt | 6 ++++++ 4 files changed, 27 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index db30ecf..8c08f27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,3 +11,12 @@ ADD_EXECUTABLE ( loader_example ADD_SUBDIRECTORY ( examples/gltfutil ) ADD_SUBDIRECTORY ( examples/glview ) ADD_SUBDIRECTORY ( examples/validator ) + +INSTALL ( FILES + json.hpp + stb_image.h + stb_image_write.h + tiny_gltf.h + DESTINATION + include + ) diff --git a/examples/gltfutil/CMakeLists.txt b/examples/gltfutil/CMakeLists.txt index eb1720a..4b51891 100644 --- a/examples/gltfutil/CMakeLists.txt +++ b/examples/gltfutil/CMakeLists.txt @@ -7,3 +7,9 @@ include_directories(../../) file(GLOB gltfutil_sources *.cc *.h) add_executable(gltfutil ${gltfutil_sources}) + +install ( TARGETS + gltfutil + DESTINATION + bin + ) diff --git a/examples/glview/CMakeLists.txt b/examples/glview/CMakeLists.txt index 4d40557..06308ca 100644 --- a/examples/glview/CMakeLists.txt +++ b/examples/glview/CMakeLists.txt @@ -32,3 +32,9 @@ target_link_libraries ( glview ${COREVIDEO_LIBRARY} ${IOKIT_LIBRARY} ) + +install ( TARGETS + glview + DESTINATION + bin + ) diff --git a/examples/validator/CMakeLists.txt b/examples/validator/CMakeLists.txt index 4dd8a80..6a8321f 100644 --- a/examples/validator/CMakeLists.txt +++ b/examples/validator/CMakeLists.txt @@ -45,3 +45,9 @@ endif() # test-zone # enable_testing() + +install ( TARGETS + tinygltf-validator + DESTINATION + bin + )