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 0
/
CMakeLists.txt
203 lines (168 loc) · 7.47 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Require a specific version of CMake. I'm using 2.8.5 as I create this file.
# Version 2.8.6 should support Visual Studio IDE creation of Qt classes.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# =============================================================================
# Establish the project name. This must be done before other commands.
# CMakeLists in this project can refer to the root source directory as
# ${TESTCODE_SOURCE_DIR} and to the root binary directory of the project
# as ${TESTCODE_BINARY_DIR}.
# Note: This also names the solution file that is generated for Visual Studio.
PROJECT(TaxiAnalysis)
# -----------------------------------------------------------------------------
# Setup the version number for the project
SET( VER_MAJOR 0 )
SET( VER_MINOR 0 )
SET( VER_PATCH 0 )
SET( VERSION_STRING
"${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
)
# =============================================================================
# Support applications
FIND_PROGRAM( DOT_COMMAND
NAMES bin/dot
PATHS $ENV{PATH}
"C:/Program Files (x86)/Graphviz2.30"
"C:/Program Files/Graphviz2.30"
)
get_filename_component( DOT_PATH ${DOT_COMMAND} PATH CACHE )
mark_as_advanced( DOT_COMMAND DOT_PATH )
# =============================================================================
# Compilation settings
# -----------------------------------------------------------------------------
# Compile options intended for more secure applications.
IF( (MSVC) )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS /DYNAMICBASE" )
# Downloaded version of Qt compiles without the built-in type but some
# developers may recompile Qt with the type set as built-in.
OPTION( COMPILE_WCHAR_BUILTIN
"Whether to treat wchar_t as a built-in type when compiling."
ON
)
IF( COMPILE_WCHAR_BUILTIN )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t" )
ELSE()
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-" )
ENDIF()
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NXCOMPAT" )
IF( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )
# 64-bit architecture
#SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH /NXCOMPAT" )
ELSEIF( "${CMAKE_SIZEOF_VOID_P}" EQUAL "4" )
# 32-bit architecture
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH" )
ELSE()
# Unknown, raise error
MESSAGE( "Unknown architecture" )
ENDIF()
ELSEIF( (CMAKE_COMPILER_IS_GNUXX) )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -ftrapv" )
ENDIF()
# -----------------------------------------------------------------------------
# Compilation flags to set new C++ standard use.
IF( CMAKE_COMPILER_IS_GNUCXX )
# Use the C++0x from std for GCC
SET( CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++0x"
)
ENDIF()
#MESSAGE( STATUS "C++ Flags: ${CMAKE_CXX_FLAGS}" )
# =============================================================================
# Global CMake configuration and setup.
# C++ message to indicate that a file is generated by CMake.
SET( CMAKE_AUTOGEN_MESSAGE_CXX "
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// WARNING: This file is autogenerated by CMake. Do not edit it directly!
// Edit the input file instead. Any changes made here will be
// overwritten the next time CMake generates the file.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
")
# -----------------------------------------------------------------------------
# Add CMake modules path so the various find operations work
LIST( APPEND
CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake/Modules
)
# -----------------------------------------------------------------------------
# Unit and component level testing.
OPTION( TEST__UNIT_TESTS
"Add component and unit level tests via RUN_TESTS target."
OFF
)
IF( TEST__UNIT_TESTS )
# Unit testing.
ENABLE_TESTING()
INCLUDE( "${PROJECT_SOURCE_DIR}/cmake/Modules/UNIT_TEST.cmake" )
ENDIF()
# -----------------------------------------------------------------------------
IF( WIN32 )
# Static analysis only setup for windows at the moment.
OPTION( TEST__STATIC_ANALYSIS
"Add targets for software verification via static analysis."
OFF
)
ENDIF()
IF( TEST__STATIC_ANALYSIS )
# PC-Lint setup
INCLUDE( "${PROJECT_SOURCE_DIR}/cmake/Modules/PC_LINT.cmake" )
ENDIF()
# -----------------------------------------------------------------------------
# Doxygen
INCLUDE( "${PROJECT_SOURCE_DIR}/cmake/Modules/DOXYGEN.cmake" )
DOXYGEN( ALL "${CMAKE_CURRENT_SOURCE_DIR}" )
# -----------------------------------------------------------------------------
# Paths within the project.
SET( WWW_DIR "${PROJECT_SOURCE_DIR}/www" )
SET( DATA_DIR "${PROJECT_SOURCE_DIR}/data" )
SET( SCRIPT_DIR "${PROJECT_SOURCE_DIR}/scripts" )
SET( TMT_DIR "${PROJECT_SOURCE_DIR}/tmt" )
SET( IMGCAP_DIR "${PROJECT_SOURCE_DIR}/../TaxiTopic_latex/image" )
# =============================================================================
# Compilation setup
# -----------------------------------------------------------------------------
# This option allows setting a path through the CMake system to help configure
# The command is in the form:
# SET( [Name of the variable to set]
# [Default value provided in the GUI]
# CACHE PATH [Text to display to the user to help configure]
SET( LIBRARY_OUTPUT_PATH
${PROJECT_BINARY_DIR}/bin/
#CACHE PATH "Single output directory for building all libraries."
)
SET( EXECUTABLE_OUTPUT_PATH
${LIBRARY_OUTPUT_PATH}
#CACHE PATH "Single output directory for building all libraries."
)
# =============================================================================
# Installation and Package Setup
SET(CPACK_PACKAGE_NAME "TaxiAnalysis")
SET(CPACK_PACKAGE_VENDOR "David A. Sheets")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Software for analyzing data")
SET(CPACK_PACKAGE_VERSION ${VERSION_STRING})
SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VER_PATCH})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "TaxiAnalysis_${VER_MAJOR}.${VER_MINOR}")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE-GPL.txt")
#IF(WIN32 AND NOT UNIX)
# # There is a bug in NSI that does not handle full unix paths properly. Make
# # sure there is at least one set of four (4) backslashes.
# SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
# SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project")
# SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.kent.edu")
# SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.kent.edu")
# SET(CPACK_NSIS_CONTACT "dsheets4@kent.edu")
# SET(CPACK_NSIS_MODIFY_PATH ON)
#ELSE(WIN32 AND NOT UNIX)
# SET(CPACK_STRIP_FILES "bin/MyExecutable")
# SET(CPACK_SOURCE_STRIP_FILES "")
#ENDIF(WIN32 AND NOT UNIX)
#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
INCLUDE(CPack)
# =============================================================================
# Recurse into the subdirectories representing the various sub-projects.
# This does not actually cause another cmake executable to run. The same
# process will walk through the project's entire directory structure.
ADD_SUBDIRECTORY (src)