Fix included glm target

This commit is contained in:
Stephen Seo 2021-08-25 11:18:22 +09:00
parent bb6a05f191
commit 8c554fece8
3 changed files with 13 additions and 19 deletions

View file

@ -31,7 +31,13 @@ find_package(Threads REQUIRED)
target_link_libraries(Example02 PUBLIC ${CMAKE_THREAD_LIBS_INIT})
find_package(glm REQUIRED)
get_target_property(GLM_INCLUDE_DIRS glm INTERFACE_INCLUDE_DIRECTORIES)
if(TARGET glm::glm)
get_target_property(GLM_INCLUDE_DIRS glm::glm INTERFACE_INCLUDE_DIRECTORIES)
elseif(TARGET glm)
get_target_property(GLM_INCLUDE_DIRS glm INTERFACE_INCLUDE_DIRECTORIES)
else()
message(FATAL_ERROR "Failed to set up glm for project")
endif()
target_include_directories(Example02 PUBLIC ${GLM_INCLUDE_DIRS})
find_program(CLANG_FORMAT "clang-format")

View file

@ -5,15 +5,9 @@
#include <fstream>
#include <thread>
#ifdef __MINGW32__
# include "/usr/include/glm/ext/matrix_transform.hpp"
# include "/usr/include/glm/gtc/matrix_transform.hpp"
# include "/usr/include/glm/matrix.hpp"
#else
# include <glm/ext/matrix_transform.hpp>
# include <glm/gtc/matrix_transform.hpp>
# include <glm/matrix.hpp>
#endif
#include <glm/ext/matrix_transform.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/matrix.hpp>
const float PI = std::acos(-1.0F);

View file

@ -12,15 +12,9 @@ constexpr float EX02_RAY_TRACER_GRAY_SPHERE_RADIUS = 1.5F;
#include <tuple>
#include <vector>
#ifdef __MINGW32__
# include "/usr/include/glm/mat4x4.hpp"
# include "/usr/include/glm/matrix.hpp"
# include "/usr/include/glm/vec3.hpp"
#else
# include <glm/mat4x4.hpp>
# include <glm/matrix.hpp>
# include <glm/vec3.hpp>
#endif
#include <glm/mat4x4.hpp>
#include <glm/matrix.hpp>
#include <glm/vec3.hpp>
namespace Ex02::RT {