-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG v1.14.0 | ||
) | ||
|
||
FetchContent_MakeAvailable(googletest) | ||
include(GoogleTest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
add_executable(Everland | ||
main.cpp | ||
${SOURCES} | ||
set(SOURCES | ||
${CMAKE_SOURCE_DIR}/src/Application.cpp | ||
${CMAKE_SOURCE_DIR}/src/logic/Game.cpp | ||
${CMAKE_SOURCE_DIR}/src/logic/Player.cpp | ||
${CMAKE_SOURCE_DIR}/src/world/World.cpp | ||
${CMAKE_SOURCE_DIR}/src/world/Generator.cpp | ||
${CMAKE_SOURCE_DIR}/src/world/MeshBuilder.cpp | ||
) | ||
|
||
target_include_directories(Everland PRIVATE ${CMAKE_SOURCE_DIR}/src) | ||
target_include_directories(Everland SYSTEM PRIVATE | ||
add_library(EverlandLib STATIC ${SOURCES}) | ||
target_link_libraries(EverlandLib PUBLIC fmt raylib raylib_cpp) | ||
|
||
target_include_directories(EverlandLib PUBLIC ${CMAKE_SOURCE_DIR}/src) | ||
target_include_directories(EverlandLib SYSTEM PUBLIC | ||
${CMAKE_SOURCE_DIR}/lib/magic_enum/include | ||
${CMAKE_SOURCE_DIR}/lib/raylib-cpp/include | ||
${CMAKE_SOURCE_DIR}/lib/PerlinNoise | ||
) | ||
|
||
target_link_libraries(Everland PRIVATE fmt raylib raylib_cpp) | ||
|
||
if (MSVC) | ||
target_compile_options(Everland PRIVATE /W4) | ||
target_compile_options(EverlandLib PUBLIC /W4) | ||
else() | ||
target_compile_options(Everland PRIVATE -Wall -Wextra -pedantic) | ||
target_compile_options(EverlandLib PUBLIC -Wall -Wextra -pedantic) | ||
endif() | ||
|
||
configure_file(${CMAKE_SOURCE_DIR}/resources/shaders/fragment.glsl ${CMAKE_BINARY_DIR}/resources/shaders/fragment.glsl COPYONLY) | ||
configure_file(${CMAKE_SOURCE_DIR}/resources/shaders/vertex.glsl ${CMAKE_BINARY_DIR}/resources/shaders/vertex.glsl COPYONLY) | ||
add_executable(Everland main.cpp ${SOURCES}) | ||
target_link_libraries(Everland PUBLIC EverlandLib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip | ||
) | ||
include(GoogleTest) | ||
|
||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
set(TEST_SOURCES | ||
world/WorldTest.cpp | ||
) | ||
add_executable(EverlandTest | ||
${SOURCES} | ||
${TEST_SOURCES} | ||
) | ||
|
||
target_include_directories(EverlandTest PRIVATE ${CMAKE_SOURCE_DIR}/src) | ||
target_include_directories(EverlandTest SYSTEM PRIVATE | ||
${CMAKE_SOURCE_DIR}/lib/magic_enum/include | ||
${CMAKE_SOURCE_DIR}/lib/raylib-cpp/include | ||
${CMAKE_SOURCE_DIR}/lib/PerlinNoise | ||
) | ||
|
||
target_link_libraries(EverlandTest gtest_main fmt raylib raylib_cpp) | ||
add_executable(EverlandTest ${TEST_SOURCES}) | ||
target_link_libraries(EverlandTest gtest gtest_main EverlandLib) | ||
|
||
gtest_discover_tests(EverlandTest) | ||
gtest_discover_tests(EverlandTest | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
add_custom_target(run_tests | ||
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure | ||
DEPENDS EverlandTest Everland | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
) | ||
set_target_properties(EverlandTest PROPERTIES FOLDER test) |