Skip to content

Commit

Permalink
refactor: update CMakeLists.txt & 3rd.cmake for raylib include
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzhHe committed Jul 12, 2024
1 parent cff5070 commit 67ee5d9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ configure_file(

# Find and include OpenGL
find_package(OpenGL REQUIRED)
find_package(raylib REQUIRED)

# Add glad library
add_library(glad "${PROJECT_SOURCE_DIR}/src/glad.c")
Expand Down
4 changes: 2 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"hidden": true,
"cacheVariables": {
"CMAKE_C_EXTENSIONS": "OFF",
"CMAKE_C_STANDARD": "23",
"CMAKE_C_STANDARD": "20",
"CMAKE_C_STANDARD_REQUIRED": "ON",
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
}
},
Expand Down
13 changes: 1 addition & 12 deletions cmake/3rd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ endif ()
CPMAddPackage(
NAME raylib
GITHUB_REPOSITORY raysan5/raylib
GIT_TAG 4.5.0
DOWNLOAD_ONLY True)
if (raylib_ADDED)
add_library(raylib INTERFACE IMPORTED)
target_include_directories(raylib INTERFACE ${raylib_SOURCE_DIR})
endif ()
GIT_TAG 5.0 )

# https://gitlab.com/libeigen/eigen.git
CPMAddPackage(
Expand Down Expand Up @@ -212,12 +207,6 @@ else ()
message(FATAL_ERROR "OpenGL not found. Please install OpenGL.")
endif ()

# Find raylib
find_package(raylib REQUIRED)
if (NOT raylib_FOUND)
message(FATAL_ERROR "raylib not found. Please install raylib.")
endif ()

# Find spdlog
find_package(spdlog REQUIRED)
if (NOT spdlog_FOUND)
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ link_libraries(
${glog_LIBRARIES}
SimpleRenderer
glad
raylib
OpenGL::GL
)

Expand Down
1 change: 1 addition & 0 deletions test/system_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target_include_directories(system_test PRIVATE
${CMAKE_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}
${raylib_INCLUDE_DIRS}
${raylib_SOURCE_DIR}/src
)

# Compile options
Expand Down
1 change: 0 additions & 1 deletion test/system_test/Window.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "Window.hpp"
#include <raylib.h>
#include <iostream>

Window::Window(int width, int height) :
Expand Down

0 comments on commit 67ee5d9

Please sign in to comment.