Make CMakeLists.txt more platform agnostic

This commit is contained in:
Stephen Seo 2021-08-25 10:58:41 +09:00
parent 5e49ef542b
commit 3340f4e422

View file

@ -25,9 +25,15 @@ endif()
add_executable(Example02 add_executable(Example02
${Example02_SOURCES}) ${Example02_SOURCES})
target_link_libraries(Example02 PUBLIC pthread)
target_compile_features(Example02 PUBLIC cxx_std_17) 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") find_program(CLANG_FORMAT "clang-format")
if(CLANG_FORMAT) if(CLANG_FORMAT)
add_custom_target( add_custom_target(