From 3340f4e422d5eff2e7580d4de5f9ce8efe14c653 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 25 Aug 2021 10:58:41 +0900 Subject: [PATCH] Make CMakeLists.txt more platform agnostic --- example02_threaded_raytracing/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/example02_threaded_raytracing/CMakeLists.txt b/example02_threaded_raytracing/CMakeLists.txt index 2540f63..64d471c 100644 --- a/example02_threaded_raytracing/CMakeLists.txt +++ b/example02_threaded_raytracing/CMakeLists.txt @@ -25,9 +25,15 @@ endif() add_executable(Example02 ${Example02_SOURCES}) -target_link_libraries(Example02 PUBLIC pthread) target_compile_features(Example02 PUBLIC cxx_std_17) +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) +target_include_directories(Example02 PUBLIC ${GLM_INCLUDE_DIRS}) + find_program(CLANG_FORMAT "clang-format") if(CLANG_FORMAT) add_custom_target(