-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (68 loc) · 2.98 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
## Project Properties
CMAKE_MINIMUM_REQUIRED(VERSION 3.10.0)
PROJECT(projectname)
SET(APPLICATION_NAME "Stock Analyzer")
SET(APPLICATION_CODENAME "${PROJECT_NAME}")
SET(APPLICATION_COPYRIGHT_YEARS "2018")
SET(APPLICATION_VERSION_MAJOR 1)
SET(APPLICATION_VERSION_MINOR 0)
SET(APPLICATION_VERSION_PATCH 0)
SET(APPLICATION_VERSION_TYPE SNAPSHOT)
SET(APPLICATION_VERSION_STRING "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}-${APPLICATION_VERSION_TYPE}")
SET(APPLICATION_VENDOR_ID "com.janebbing")
SET(APPLICATION_VENDOR_NAME "Jan Ebbing")
SET(APPLICATION_VENDOR_URL "janebbing.com")
SET(APPLICATION_ID "${APPLICATION_VENDOR_ID}.${PROJECT_NAME}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
## Project Output Paths
SET(MAINFOLDER ${PROJECT_SOURCE_DIR})
SET(EXECUTABLE_OUTPUT_PATH "${MAINFOLDER}/bin")
SET(LIBRARY_OUTPUT_PATH "${MAINFOLDER}/lib")
## Project Search Paths
LIST(APPEND CMAKE_PREFIX_PATH "${MAINFOLDER}")
LIST(APPEND CMAKE_PREFIX_PATH "${MAINFOLDER}/tools")
LIST(APPEND CMAKE_PREFIX_PATH "${MAINFOLDER}/thirdparty")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${MAINFOLDER}/tools/share/cmake")
INCLUDE_DIRECTORIES("${MAINFOLDER}/include")
## C++ Standard
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
## C++ Flags ()
##add_definitions(-D_GLIBCXX_USE_CXX11ABI=0)
add_definitions(-lstdc++fs)
add_definitions(-g)
## Use 0 for debugging, 1 for release
SET(CMAKE_VERBOSE_MAKEFILE 0)
## Add Code Coverage Target for Supported Compilers
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
INCLUDE(CodeCoverage)
ENDIF()
## Project Dependencies
FIND_PACKAGE(Boost 1.68 COMPONENTS "program_options" "date_time" REQUIRED)
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Gui Widgets Charts)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Charts)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Charts)
## Project Sources
FILE(GLOB_RECURSE PROJECT_SRCS ${MAINFOLDER}/src/*.cpp ${MAINFOLDER}/src/*.h)
FILE(GLOB_RECURSE TEST_SRCS ${MAINFOLDER}/test/*.cpp ${MAINFOLDER}/test/*.h)
## Configure Files
FILE(GLOB_RECURSE CONFIGINPUTS1 include/*.h.in.cmake)
FILE(GLOB_RECURSE CONFIGINPUTS2 src/*.h.in.cmake)
LIST(APPEND CONFIGINPUTS "${CONFIGINPUTS1}")
LIST(APPEND CONFIGINPUTS "${CONFIGINPUTS2}")
FOREACH(CONFIGINPUT ${CONFIGINPUTS})
STRING(REPLACE ".h.in.cmake" ".h" CONFIGOUTPUT1 "${CONFIGINPUT}")
CONFIGURE_FILE("${CONFIGINPUT}" "${CONFIGOUTPUT1}")
ENDFOREACH(CONFIGINPUT ${CONFIGINPUTS})
## Add Build Targets
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(thirdparty)
ADD_SUBDIRECTORY(test)
## Add Install Targets
IF(EXISTS "${MAINFOLDER}/include/${PROJECT_NAME}" AND IS_DIRECTORY "${MAINFOLDER}/include/${PROJECT_NAME}")
INSTALL(DIRECTORY "${MAINFOLDER}/include/${PROJECT_NAME}" DESTINATION "include")
ENDIF(EXISTS "${MAINFOLDER}/include/${PROJECT_NAME}" AND IS_DIRECTORY "${MAINFOLDER}/include/${PROJECT_NAME}")
## Add Documentation Targets
INCLUDE(DocumentationTargets)