mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-25 23:49:03 +00:00
Adding a FindCatch2.cmake and cleaning up raylib import
This commit is contained in:
+6
-3
@@ -4,11 +4,14 @@ project(Bomberman)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/lib/wal)
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/lib/raylib)
|
||||
|
||||
add_executable(bomberman
|
||||
sources/main.cpp
|
||||
)
|
||||
|
||||
find_package(raylib REQUIRED)
|
||||
target_link_libraries(bomberman wal raylib)
|
||||
find_package(raylib QUIET)
|
||||
if (NOT raylib_FOUND)
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/lib/raylib)
|
||||
find_package(raylib REQUIRED)
|
||||
endif()
|
||||
target_link_libraries(bomberman wal raylib)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
|
||||
|
||||
|
||||
if (NOT Catch2_FOUND)
|
||||
Include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.13.1)
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
endif()
|
||||
@@ -38,5 +38,11 @@ add_executable(wal_tests EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
target_link_libraries(wal_tests PRIVATE wal)
|
||||
find_package(Catch2 REQUIRED)
|
||||
target_link_libraries(wal_tests PRIVATE Catch2::Catch2)
|
||||
|
||||
find_package(Catch2 QUIET)
|
||||
if (NOT Catch2_FOUND)
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../catch2)
|
||||
find_package(Catch2 REQUIRED)
|
||||
endif()
|
||||
|
||||
target_link_libraries(wal_tests PRIVATE Catch2::Catch2)
|
||||
|
||||
Reference in New Issue
Block a user