Skip to content
Snippets Groups Projects
Commit 2bf969e5 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

hack opengl and glfw detection for windows

parent 6a4e91ad
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,6 @@ project(fggl
##
# begin conan support
##
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
......@@ -23,8 +20,12 @@ if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
TLS_VERIFY ON)
endif()
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
include(${CMAKE_BINARY_DIR}/conan.cmake)
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
#list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
#list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
#conan_cmake_autodetect(settings)
conan_cmake_run(CONANFILE conanfile.txt # or relative build/conanfile.txt
BUILD_TYPE ${CONAN_BUILD_TYPE}
......@@ -89,8 +90,15 @@ if (DOXYGEN_FOUND)
endif (DOXYGEN_FOUND)
# depedencies
find_package( glfw3 CONFIG REQUIRED )
target_link_libraries(fggl PRIVATE glfw)
find_package( glfw3 )
if ( GLFW3_FOUND )
target_link_libraries(fggl PRIVATE glfw)
else()
message("GLFW couldn't be found - something strange is going on")
find_package( CONAN_PKG::glfw )
target_link_libraries(fggl PRIVATE glfw)
endif()
# engine
#add_subdirectory(vendor/imgui/)
......
......@@ -2,6 +2,7 @@
# Config mode dependencies
find_package(fmt CONFIG)
find_package(spdlog CONFIG)
find_package(glfw3 CONFIG)
configure_file(FgglConfig.h.in FgglConfig.h)
......
......@@ -14,9 +14,17 @@ find_package( glm REQUIRED )
target_link_libraries(${PROJECT_NAME} PUBLIC glm::glm)
# OpenGL Backend
find_package( OpenGL REQUIRED )
include_directories( ${OPENGL_INCLUDE_DIR} )
target_link_libraries(${PROJECT_NAME} PUBLIC OpenGL::OpenGL)
if ( WIN32 )
message("There is a hack to make opengl detection work on windows, someone should look into this...")
find_package( opengl REQUIRED )
include_directories( ${OPENGL_INCLUDE_DIR} )
target_link_libraries(${PROJECT_NAME} PUBLIC opengl::opengl)
else()
find_package( OpenGL REQUIRED )
include_directories( ${OPENGL_INCLUDE_DIR} )
target_link_libraries(${PROJECT_NAME} PUBLIC OpenGL::OpenGL)
endif()
# GLEW
find_package( glad )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment