Skip to content

Commit

Permalink
Added FindFastGLTF.cmake, FindGLM.cmake, and FindSTB.cmake scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
droettger committed Apr 30, 2024
1 parent 7987cec commit eb73778
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
36 changes: 36 additions & 0 deletions 3rdparty/CMake/FindFastGLTF.cmake
Original file line number Diff line number Diff line change
@@ -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\<msc-toolset>\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}")

26 changes: 26 additions & 0 deletions 3rdparty/CMake/FindGLM.cmake
Original file line number Diff line number Diff line change
@@ -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}")
26 changes: 26 additions & 0 deletions 3rdparty/CMake/FindSTB.cmake
Original file line number Diff line number Diff line change
@@ -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}")

0 comments on commit eb73778

Please sign in to comment.