From 3e5b6b4a33f2e8455ff4da923ed7b73899d219a1 Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Thu, 21 Apr 2022 16:38:17 +0100 Subject: [PATCH] fix the library includes for glfw --- CMakeLists.txt | 3 --- build.sh | 17 ++--------------- fggl/gfx/CMakeLists.txt | 14 +++++--------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 815d902..f8c8708 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,6 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH}) include( cmake/conan.cmake ) - execute_process( COMMAND ls ${CMAKE_BINARY_DIR} ) - conan_cmake_configure( REQUIRES opengl/system @@ -37,7 +35,6 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if ( CMAKE_CONFIGURATION_TYPES ) foreach(TYPE ${CMAKE_CONFIGURATION_TYPES}) - execute_process( COMMAND echo "BUILD TYPE: " ${TYPE} ) conan_cmake_autodetect( settings BUILD_TYPE ${TYPE} ) conan_cmake_install( PATH_OR_REFERENCE . diff --git a/build.sh b/build.sh index 183ef6d..475ece5 100755 --- a/build.sh +++ b/build.sh @@ -23,21 +23,8 @@ rm -rf $CACHE # # build step # -pushd builds/cli -cmake ../.. -if [ $? -ne 0 ] -then - echo "[!] Cmake failed" - exit 1 -fi - -make -if [ $? -ne 0 ] -then - echo "[!] make failed" - exit 1 -fi -popd +cmake -S . -B build -DCMAKE_BUILD_TYPE=debug +cmake --build build # # additional stuff diff --git a/fggl/gfx/CMakeLists.txt b/fggl/gfx/CMakeLists.txt index 2d3833f..bc49864 100644 --- a/fggl/gfx/CMakeLists.txt +++ b/fggl/gfx/CMakeLists.txt @@ -1,20 +1,16 @@ # Sources + +find_package( glfw3 REQUIRED ) +target_link_libraries(fggl PUBLIC glfw) + target_sources(fggl PRIVATE window.cpp input.cpp - atlas.cpp + atlas.cpp ) -find_package( glfw3 ) -if ( GLFW3_FOUND ) - target_link_libraries(fggl PRIVATE glfw) -else() - message("GLFW couldn't be found - something strange is going on") - target_link_libraries(fggl PRIVATE glfw) -endif() - # OpenGL backend add_subdirectory(ogl) add_subdirectory(ogl4) -- GitLab