-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (32 loc) · 1.25 KB
/
CMakeLists.txt
File metadata and controls
40 lines (32 loc) · 1.25 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
cmake_minimum_required (VERSION 3.10)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set (HAVE_CMAKE true)
# https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html
set(CMAKE_CXX_STANDARD 17)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
project (shared)
include (CXXSniffer)
include (CheckFunctionExists)
set (PROJECT_VERSION "1.0.0")
set (PACKAGE "${PROJECT_NAME}")
set (VERSION "${PROJECT_VERSION}")
set (PACKAGE_BUGREPORT "support@taskwarrior.org")
set (PACKAGE_NAME "${PACKAGE}")
set (PACKAGE_TARNAME "${PACKAGE}")
set (PACKAGE_VERSION "${VERSION}")
set (PACKAGE_STRING "${PACKAGE} ${VERSION}")
if (PROJECT_IS_TOP_LEVEL)
# cmake.h should only be configured if libshared is not used as a CMake subdirectory.
# If libshared is a CMake subdirectory, the top-level project already configures
# cmake.h by itself.
check_function_exists(strlcpy HAVE_STRLCPY)
check_function_exists(timegm HAVE_TIMEGM)
message ("-- Configuring cmake.h")
configure_file (
${CMAKE_CURRENT_SOURCE_DIR}/cmake.h.in
${CMAKE_CURRENT_SOURCE_DIR}/cmake.h)
endif (PROJECT_IS_TOP_LEVEL)
add_subdirectory (src)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test)