-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (49 loc) · 2.16 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
cmake_minimum_required(VERSION 3.13)
project(Schasch++)
set(CMAKE_CXX_STANDARD 17)
## === INCLUDE HEADER FILES ===
## -- for SFML --
if (WIN32) # in Windows include directories from SFML/include
include_directories("$ENV{ProgramW6432}/SFML/include")
endif (WIN32)
if (APPLE)
# custom Apple CMake goes here
endif (APPLE)
## -- // --
## === SET VARIABLES ===
## -- for SFML --
if (WIN32)
set(SFML_STATIC_LIBRARIES TRUE) # if you want to link SFML statically (for Windows)
set(SFML_DIR "$ENV{ProgramW6432}/SFML/lib/cmake/SFML") # In most cases better set in the CMake cache
endif (WIN32)
if (APPLE)
# custom Apple CMake goes here
endif (APPLE)
## -- // --
## === INCLUDE PACKAGES ===
## include SFML packages (must be in Windows PATH variable!)
find_package(SFML 2.5 COMPONENTS system window graphics audio network REQUIRED)
## -- // --
## === Set SOURCE/HEADER variables ===
set(SOURCE_FILES src/main.cpp src/Controller/Game.cpp src/Controller/RunningGame.cpp src/Model/Chesspieces/Bishop.cpp src/Model/Chesspieces/ChesspiecesTypeContainer.cpp src/Model/Chesspieces/King.cpp src/Model/Chesspieces/Knight.cpp src/Model/Chesspieces/Pawn.cpp src/Model/Chesspieces/PlayableChesspiece.cpp src/Model/Chesspieces/Queen.cpp src/Model/Chesspieces/Rook.cpp src/Model/Chesspieces/Straightwalker.cpp src/Model/Chessboard.cpp src/Model/Move.cpp src/Model/MoveHistory.cpp src/Model/Observable.cpp src/Model/Observer.cpp src/Model/Team.cpp src/Model/Tile.cpp src/View/IView.cpp)
set(HEADER_FILES)
## === GENERATING EXECUTABLES ===
## -- Executable "CMake_Test" --
add_executable(Schasch__ ${SOURCE_FILES} ${HEADER_FILES})
## -- // --
## === LINK LIBRARIES TO EXECUTABLES ===
## -- SFML libraries --
target_link_libraries(Schasch__ sfml-system sfml-window sfml-graphics sfml-audio sfml-network)
## -- // --
## === COPY LIBRARIES ===
## -- SFML libraries --
if (WIN32) # Copy .dll Files to Working Directory (for Windows)
target_include_directories(Schasch__ PUBLIC "$ENV{ProgramW6432}/SFML/lib")
endif (WIN32)
if (APPLE)
# custom Apple CMake goes here
endif (APPLE)
## -- // --
## === COPY RESOURCE FILES TO WORKING DIRECTORY ===
file(COPY res DESTINATION ${CMAKE_BINARY_DIR})
## -- // --