-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (39 loc) · 1.89 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
cmake_minimum_required(VERSION 3.0)
project(LOGGING)
set(LOGGING_VERSION_MAJOR 1)
set(LOGGING_VERSION_MINOR 0)
set(LOGGING_VERSION_PATCH 0)
set(LOGGING_VERSION ${LOGGING_VERSION_MAJOR}.${LOGGING_VERSION_MINOR}.${LOGGING_VERSION_PATCH})
set(LOGGING_VERSION_CMAKE ${PROJECT_BINARY_DIR}/logging-config-version.cmake)
configure_file(cmake/logging-config-version.cmake.in ${LOGGING_VERSION_CMAKE} @ONLY)
set(LOGGING_CONFIG_CMAKE ${PROJECT_BINARY_DIR}/logging-config.cmake)
configure_file(cmake/logging-config.cmake.in ${LOGGING_CONFIG_CMAKE} @ONLY)
################################################################################
# Library Configuration
################################################################################
message(STATUS "LOGGING_INCLUDE_PREFIX: ${LOGGING_INCLUDE_PREFIX}")
# THIS IS A HEADER FILE ONLY TARGET
add_library(logging INTERFACE)
target_include_directories(logging
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/logging-${LOGGING_VERSION}>
)
################################################################################
# Install Configuration
################################################################################
install(TARGETS logging
EXPORT logging
DESTINATION lib/logging-${LOGGING_VERSION})
install(FILES Logging.h DESTINATION include/logging-${LOGGING_VERSION}/${LOGGING_INCLUDE_PREFIX})
install(FILES ${LOGGING_CONFIG_CMAKE} DESTINATION lib/logging-${LOGGING_VERSION})
install(FILES ${LOGGING_VERSION_CMAKE} DESTINATION lib/logging-${LOGGING_VERSION})
install(EXPORT logging DESTINATION lib/logging-${LOGGING_VERSION})
set(CPACK_PACKAGE_NAME "logging")
set(CPACK_SET_DESTDIR ON)
set(CPACK_GENERATOR "DEB")
set(CPACK_INSTALL_PREFIX "/usr/local")
set(CPACK_PACKAGE_VERSION ${LOGGING_VERSION})
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "doerthous")
include(CPack)