-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
65 lines (57 loc) · 2.31 KB
/
CMakeLists.txt
File metadata and controls
65 lines (57 loc) · 2.31 KB
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
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
foreach(
p
CMP0020 # Automatically link Qt executables to qtmain target on Windows.
CMP0022 # INTERFACE_LINK_LIBRARIES defines the link interface.
CMP0025 # Compiler id for Apple Clang is now AppleClang.
CMP0053 # Simplify variable reference and escape sequence evaluation.
CMP0054 # Only interpret if() arguments as variables or keywords when
# unquoted.
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
endif()
endforeach()
project(project_name VERSION 0.0.0.0 LANGUAGES CXX)
# Project-cmake files
set(project_name_CMAKE_DIR "${project_name_SOURCE_DIR}/cmake/Modules")
set(CMAKE_MODULE_PATH ${project_name_CMAKE_DIR} ${CMAKE_MODULE_PATH})
# Set up our directory structure for output libraries and binaries
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${project_name_BINARY_DIR}/bin")
endif()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
if(UNIX)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${project_name_BINARY_DIR}/lib")
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${project_name_BINARY_DIR}/bin")
endif()
endif()
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${project_name_BINARY_DIR}/lib")
endif()
mark_as_advanced(
CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
)
# ------------------------------------------------------------------------------
# Compilers
# ------------------------------------------------------------------------------
include(CompilerConfig)
# ------------------------------------------------------------------------------
# Static checks
# ------------------------------------------------------------------------------
include(CppCheck)
# ------------------------------------------------------------------------------
# Testing
# ------------------------------------------------------------------------------
option(ENABLE_TESTING "If enabled add tests to ctest targets" ON)
if(ENABLE_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# googlemock includes googlemock test targets
add_subdirectory(external/googletest/googlemock)
enable_testing()
endif()
# ------------------------------------------------------------------------------
# Sources
# ------------------------------------------------------------------------------