-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (36 loc) · 1.21 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.10)
set(CMAKE_BUILD_TYPE Debug)
set (CMAKE_CXX_STANDARD 17)
# Set the project name
project(game-demo CXX)
# Set the directory for the executable
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
# Set the directory for the test executables
set(TEST_EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/test")
# Add the source files for the main program
set(SOURCES
ncurses-game-engine.cpp
game-demo.cpp
)
# Add the test files
set(TEST_SOURCES
# test/stringEditor_tests.cpp
)
# Find ncurses library and include
Find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
# Find the Boost library and include the Boost test framework
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
include_directories(${Boost_INCLUDE_DIRS})
# Add the executable for the main program
add_executable(game-demo ${SOURCES})
target_link_libraries(game-demo ${CURSES_LIBRARIES})
# Enable testing with CTest
enable_testing()
# Add the test executables
foreach(test_src ${TEST_SOURCES})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} ${test_src})
target_link_libraries(${test_name} ${Boost_LIBRARIES})
add_test(NAME ${test_name} COMMAND ${test_name})
endforeach()