diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8c08f27 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ +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 ) + +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 new file mode 100644 index 0000000..06308ca --- /dev/null +++ b/examples/glview/CMakeLists.txt @@ -0,0 +1,40 @@ +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} + ) + +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 + )