CMakeLists.txt fixes

This commit is contained in:
Dawid Pietrykowski 2023-06-05 19:48:21 +02:00
parent 90268c3e43
commit 24064274c5

View File

@ -55,34 +55,6 @@ set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
#find_path(GLFW_INCLUDE_DIR GLFW/glfw3.h
#HINTS
#${CMAKE_CURRENT_SOURCE_DIR}/include
#${CMAKE_CURRENT_SOURCE_DIR}/lib
#${GLFW_ROOT}
#${GLFW_ROOT}/include)
#
#if(GLFW_INCLUDE_DIR)
#message(STATUS "GLFW_INCLUDE_DIR: ${GLFW_INCLUDE_DIR}")
#else()
#message(FATAL_ERROR "glfw3.h not found")
#endif()
#
#find_path(GLFW_LIB_DIR glfw3.lib
#HINTS
#${CMAKE_CURRENT_SOURCE_DIR}/include
#${CMAKE_CURRENT_SOURCE_DIR}/lib
#${GLFW_ROOT}/lib
#${GLFW_ROOT}/lib-vc2019
#${GLFW_ROOT}/lib-vc2017
#${GLFW_ROOT}/lib-vc2015)
#
#if(GLFW_LIB_DIR)
#message(STATUS "GLFW_LIB_DIR: ${GLFW_LIB_DIR}")
#else()
#message(FATAL_ERROR "glfw3.lib not found")
#endif()
find_package(glfw3 REQUIRED)
# Find GLEW
@ -90,8 +62,6 @@ find_package(GLEW REQUIRED)
if(GLEW_FOUND)
set(GLEW_INCLUDE_DIR ${GLEW_INCLUDE_DIRS})
message(STATUS "GLEW_LIBRARIES: ${GLEW_LIBRARIES}")
get_filename_component(GLEW_LIBRARIES ${GLEW_LIBRARIES} DIRECTORY)
message(STATUS "GLEW_INCLUDE_DIR: ${GLEW_INCLUDE_DIR}")
message(STATUS "GLEW_LIBRARIES: ${GLEW_LIBRARIES}")
else()
@ -122,9 +92,9 @@ ${GLEW_INCLUDE_DIR})
target_link_directories(${PROJECT_NAME} PUBLIC ${GLFW_LIB_DIR} ${GLEW_LIBRARIES})
if(WIN32)
target_link_libraries(${PROJECT_NAME} glfw GLEW::GLEW ComputeEngine)
target_link_libraries(${PROJECT_NAME} glfw GLEW::GLEW)
else()
target_link_libraries(${PROJECT_NAME} glfw OpenGL::GL GLEW::GLEW ComputeEngine)
target_link_libraries(${PROJECT_NAME} glfw OpenGL::GL GLEW::GLEW)
endif()
# Header files