-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (55 loc) · 1.37 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 2.8)
project(freecell4cli CXX)
set(CMAKE_CXX_STANDARD 14)
set(BUILD_WITH_CURSES TRUE)
add_subdirectory("LibCard")
list(APPEND Sources
"main.cpp"
"Board.h"
"Board.cpp"
"Homecell.h"
"Freecell.h"
"PlayArea.h"
"PlayArea.cpp"
"Constants.h"
"Command.h"
"Command.cpp"
"MoveCommand.h"
"GameScreen.h"
"Input.h"
"Input.cpp"
"Prompt.h"
"Output.h"
"Output.cpp"
"HelpScreen.h"
"ValidMoveCommand.h"
"Helper.h"
"Helper.cpp"
)
if(BUILD_WITH_CURSES)
list(APPEND Sources
"Curses/HelpScreen.cpp"
"Curses/GameScreen.cpp"
"Curses/Prompt.cpp"
"Curses/Curses.h"
"Curses/Curses.cpp"
)
add_definitions(-DBUILD_WITH_CURSES=${BUILD_WITH_CURSES})
find_package(Curses)
include_directories(${CURSES_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} ${Sources})
target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES})
else()
list(APPEND Sources
"Std/HelpScreen.cpp"
"Std/GameScreen.cpp"
"Std/Prompt.cpp"
)
add_executable(${PROJECT_NAME} ${Sources})
endif()
target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES} "Card")
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Weffc++)
endif()