From eb737786c3dc0559df79af335c30049fddd72632 Mon Sep 17 00:00:00 2001 From: droettger Date: Tue, 30 Apr 2024 14:53:13 +0200 Subject: [PATCH] Added FindFastGLTF.cmake, FindGLM.cmake, and FindSTB.cmake scripts. --- 3rdparty/CMake/FindFastGLTF.cmake | 36 +++++++++++++++++++++++++++++++ 3rdparty/CMake/FindGLM.cmake | 26 ++++++++++++++++++++++ 3rdparty/CMake/FindSTB.cmake | 26 ++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 3rdparty/CMake/FindFastGLTF.cmake create mode 100644 3rdparty/CMake/FindGLM.cmake create mode 100644 3rdparty/CMake/FindSTB.cmake diff --git a/3rdparty/CMake/FindFastGLTF.cmake b/3rdparty/CMake/FindFastGLTF.cmake new file mode 100644 index 00000000..54c4f3f4 --- /dev/null +++ b/3rdparty/CMake/FindFastGLTF.cmake @@ -0,0 +1,36 @@ +# Looks for the environment variable: +# FASTGLTF_PATH + +# Sets the variables : +# FASTGLTF_INCLUDE_DIR +# FASTGLTF_LIBRARY + +# FastGLTF_FOUND + +set(FASTGLTF_PATH $ENV{FASTGLTF_PATH}) + +if ("${FASTGLTF_PATH}" STREQUAL "") + set(FASTGLTF_PATH "${LOCAL_3RDPARTY}/fastgltf") +endif() + +message("FASTGLTF_PATH = " "${FASTGLTF_PATH}") + +# After the fastgltf INSTALL project ran, the release library resides in 3rdparty/fastgltf/lib +# Unfortunately that is always only one build target. +# The 3rdparty.cmake script builds both Debug and Release targets under Windows but installs only the the Release target. +# If you need to run the GLTF_renderer as Debug target, copy the files from 3rdparty\fastgltf\build\\Debug to 3rdparty\fastgltf\lib + +set(FASTGLTF_INCLUDE_DIR "${FASTGLTF_PATH}/include") +message("FASTGLTF_INCLUDE_DIR = " "${FASTGLTF_INCLUDE_DIR}") + +find_library(FASTGLTF_LIBRARY NAMES fastgltf PATHS "${FASTGLTF_PATH}/lib") +message("FASTGLTF_LIBRARY = " "${FASTGLTF_LIBRARY}") + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(FastGLTF DEFAULT_MSG FASTGLTF_INCLUDE_DIR FASTGLTF_LIBRARY) + +mark_as_advanced(FASTGLTF_INCLUDE_DIR FASTGLTF_LIBRARY) + +message("FastGLTF_FOUND = " "${FastGLTF_FOUND}") + \ No newline at end of file diff --git a/3rdparty/CMake/FindGLM.cmake b/3rdparty/CMake/FindGLM.cmake new file mode 100644 index 00000000..35418049 --- /dev/null +++ b/3rdparty/CMake/FindGLM.cmake @@ -0,0 +1,26 @@ +# Looks for the environment variable: +# GLM_PATH + +# Sets the variables : +# GLM_INCLUDE_DIR + +# GLM_FOUND + +set(GLM_PATH $ENV{GLM_PATH}) + +if ("${GLM_PATH}" STREQUAL "") + set(GLM_PATH "${LOCAL_3RDPARTY}/glm") +endif() + +message("GLM_PATH = " "${GLM_PATH}") + +set(GLM_INCLUDE_DIR "${GLM_PATH}") +message("GLM_INCLUDE_DIR = " "${GLM_INCLUDE_DIR}") + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(GLM DEFAULT_MSG GLM_INCLUDE_DIR) + +mark_as_advanced(GLM_INCLUDE_DIR) + +message("GLM_FOUND = " "${GLM_FOUND}") diff --git a/3rdparty/CMake/FindSTB.cmake b/3rdparty/CMake/FindSTB.cmake new file mode 100644 index 00000000..710acbbd --- /dev/null +++ b/3rdparty/CMake/FindSTB.cmake @@ -0,0 +1,26 @@ +# Looks for the environment variable: +# STB_PATH + +# Sets the variables : +# STB_INCLUDE_DIR + +# STB_FOUND + +set(STB_PATH $ENV{STB_PATH}) + +if ("${STB_PATH}" STREQUAL "") + set(STB_PATH "${LOCAL_3RDPARTY}/stb") +endif() + +message("STB_PATH = " "${STB_PATH}") + +set(STB_INCLUDE_DIR "${STB_PATH}") +message("STB_INCLUDE_DIR = " "${STB_INCLUDE_DIR}") + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(STB DEFAULT_MSG STB_INCLUDE_DIR) + +mark_as_advanced(STB_INCLUDE_DIR) + +message("STB_FOUND = " "${STB_FOUND}")