This repository has been archived by the owner on May 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
97 lines (64 loc) · 2.22 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
# Configure project
PROJECT( golPlayground )
# Configuration CMake Module Path
SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake" )
# Choose default build type (if none specified)
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Debug )
ENDIF()
# Disable in-source builds
IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
MESSAGE( FATAL_ERROR "In-source builds are not allowed. Please create a new directory (a Build directory)." )
ENDIF()
# Compilation flags
INCLUDE( CompileFlags )
# Set prefix path if none specified
IF( NOT CMAKE_PREFIX_PATH )
SET( CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR} )
ENDIF()
# Configure Whimsical sources
INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/Includes" )
FILE( GLOB_RECURSE GOL_SOURCES "Sources/*.cpp" )
FILE( GLOB_RECURSE GOL_HEADERS "Includes/*.hpp" )
FILE( GLOB_RECURSE GOL_INLINES "Includes/*.inl" )
FILE(
GLOB_RECURSE
GOL_FILES
${GOL_SOURCES}
${GOL_HEADERS}
${GOL_INLINES}
)
# Configuring SFML
FIND_PACKAGE( SFML 2.5.1 REQUIRED system window graphics network audio )
if(NOT SFML_FOUND)
message(FATAL_ERROR "Could not find SFML")
endif()
INCLUDE_DIRECTORIES( ${SFML_INCLUDE_DIR} )
# Configuring TGUI
FIND_PACKAGE( TGUI 0.8 REQUIRED )
if(NOT TGUI_FOUND)
message(FATAL_ERROR "Could not find TGUI")
endif()
INCLUDE_DIRECTORIES( ${TGUI_INCLUDE_DIR} )
# Configuring Catch2
INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/Submodules/Catch2/single_include" )
# Configuring Doxygen target
FIND_PACKAGE( Doxygen )
IF( DOXYGEN_FOUND )
SET( DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Documentation/Doxyfile.in )
SET( DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Documentation/Doxyfile )
CONFIGURE_FILE( ${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY )
ADD_CUSTOM_TARGET(
Documentation ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Documentation
COMMENT "Generating documentation using Doxygen"
VERBATIM
)
ELSE()
MESSAGE( STATUS "${PROJECT_NAME} : Doxygen need to be installed to generate documentation" )
ENDIF()
# Configuring targets
ADD_SUBDIRECTORY( Application )
ADD_SUBDIRECTORY( Tests )