forked from p4lang/tdi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
63 lines (53 loc) · 2.14 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
cmake_minimum_required(VERSION 3.5)
project(libtdi VERSION 0.1 LANGUAGES CXX)
ENABLE_TESTING()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 11)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
file(COPY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/
PATTERN "*.doxy" EXCLUDE
PATTERN "*.am" EXCLUDE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third-party)
include_directories(.)
if(STANDALONE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third-party/target-syslibs/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third-party/target-utils/include)
endif()
add_subdirectory(third-party)
set(C_CXX_FLAGS "-Wall -Wextra -Werror -Wshadow -Wpedantic -Wno-missing-field-initializers ")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,defs")
if(COVERAGE)
set(C_CXX_FLAGS "${C_CXX_FLAGS} --coverage")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_CXX_FLAGS}")
add_subdirectory(src)
#
## Building tdi doxygen
#find_package(Doxygen)
#if(DOXYGEN_FOUND)
# set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}/docs)
# set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
# set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# configure_file(${doxyfile_in} ${doxyfile} @ONLY)
# add_custom_target(doc-tdi
# COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# COMMENT "Generating TDI Doxygen"
# VERBATIM)
# set_target_properties(doc-tdi PROPERTIES EXCLUDE_FROM_ALL TRUE)
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION
# share/doc/tdi OPTIONAL)
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex DESTINATION
# share/doc/tdi OPTIONAL)
#
#else()
# message(WARNING "Doxygen is needed to build the documentation. Please install doxygen.")
#endif()
#