forked from cheshirekow/cmake_format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
94 lines (81 loc) · 2.83 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
cmake_minimum_required(VERSION 3.5)
project(cheshirekow)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
include(${CMAKE_SOURCE_DIR}/cmake/codestyle.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/ctest_helpers.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/doctools.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/pkgconfig.cmake)
find_package(Threads REQUIRED)
pkg_find(
PKG eigen3
PKG fontconfig
PKG freetype2
PKG fuse
PKG glib-2.0
PKG gnuradio-osmosdr
PKG gnuradio-filter
PKG gtk+-3.0
PKG gtkmm-3.0
PKG libcurl
PKG libglog
PKG libpng NAMES libpng12 libpng16
PKG librtlsdr
PKG libudev
PKG tinyxml2
PKG vulkan
PKG x11-xcb)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/third_party/googletest/include)
include_directories(${CMAKE_SOURCE_DIR}/third_party/re2)
include_directories(${CMAKE_SOURCE_DIR}/third_party/fmt/include)
include_directories(${CMAKE_SOURCE_DIR}/third_party/glm)
set(CXX_STANDARD
"c++11"
CACHE STRING "argument to '-std=' for C++ compiler")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${CXX_STANDARD}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
add_custom_target(format)
add_custom_target(lint)
add_custom_target(doc)
set(ENV{PYTHONPATH} ${CMAKE_SOURCE_DIR})
set(CTEST_ENVIRONMENT "PYTHONPATH=${CMAKE_SOURCE_DIR}")
set_property(GLOBAL PROPERTY gloal_doc_files "")
# NOTE(josh): search through the list of child directories and add any that
# actually contain a listfile. While globs are evil, this is necessary for
# sparse checkouts. We can and should correctly add dependencies for this glob
# in order to retrigger cmake.
file(
GLOB children
RELATIVE ${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/*)
foreach(child ${children})
if(EXISTS ${CMAKE_SOURCE_DIR}/${child}/CMakeLists.txt)
message("Enabling subdirectory '${child}' for this checkout")
add_subdirectory(${child})
endif()
endforeach()
# NOTE(josh): some sparse checkouts don't include doxygen
if(EXISTS ${CMAKE_SOURCE_DIR}/doxy.config.in)
# configure the doxygen configuration
# NOTE(josh): maybe want to expose this for editor integration
# ~~~
# set(DOXY_WARN_FORMAT "\"$file($line) : $text \"")
# set(DOXY_WARN_FORMAT "\"$file:$line: $text \"")
# ~~~
configure_file("${PROJECT_SOURCE_DIR}/doxy.config.in"
"${PROJECT_BINARY_DIR}/doxy.config")
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/doxy.stamp
COMMAND doxygen ${PROJECT_BINARY_DIR}/doxy.config
COMMAND touch ${PROJECT_BINARY_DIR}/doxy.stamp
DEPENDS ${PROJECT_BINARY_DIR}/doxy.config
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(doxygen DEPENDS ${PROJECT_BINARY_DIR}/doxy.stamp)
add_dependencies(doc doxygen)
endif()
add_custom_target(
better-test
COMMAND ctest --force-new-ctest-process --output-on-failure
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Execute ctest")