From 2123da775b699176b77131a9db57129da66d6a4a Mon Sep 17 00:00:00 2001 From: Tan Meng Yue Date: Fri, 7 Dec 2018 20:45:13 +1100 Subject: [PATCH] Add CMake package for developer Added the glTFConfig.cmake file so that once installed, it is easy for developers to find all the path location for include purposes. --- CMakeLists.txt | 6 ++++++ cmake/glTFConfig.cmake | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 cmake/glTFConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c08f27..31647f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,3 +20,9 @@ INSTALL ( FILES DESTINATION include ) + +INSTALL ( FILES + cmake/glTFConfig.cmake + DESTINATION + cmake + ) diff --git a/cmake/glTFConfig.cmake b/cmake/glTFConfig.cmake new file mode 100644 index 0000000..c1502ee --- /dev/null +++ b/cmake/glTFConfig.cmake @@ -0,0 +1,17 @@ +# -*- cmake -*- +# - Find glTF + +# glTF_INCLUDE_DIR glTF's include directory + + +FIND_PACKAGE ( PackageHandleStandardArgs ) + +SET ( glTF_INCLUDE_DIR "${glTF_DIR}/../include" CACHE STRING "glTF include directory") + +FIND_FILE ( glTF_HEADER tiny_gltf.h PATHS ${glTF_INCLUDE_DIR} ) + +IF (glTF_HEADER) + # MESSAGE ( STATUS "FOUND tiny_gltf.h, glTF_INCLUDE_DIR = ${glTF_INCLUDE_DIR}") +ELSE () + MESSAGE ( FATAL_ERROR "Unable to find tiny_gltf.h, glTF_INCLUDE_DIR = ${glTF_INCLUDE_DIR}") +ENDIF ()