-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathCMakeLists.txt
99 lines (81 loc) · 2.58 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
95
96
97
98
99
cmake_minimum_required(VERSION 3.5)
project(EWAHBoolArray
DESCRIPTION "A compressed bitmap class in C++"
LANGUAGES CXX
VERSION 0.8.0
)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(cmake/ewah-flags.cmake)
add_library(ewah INTERFACE)
target_include_directories(
ewah
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
add_library(ewah::ewah ALIAS ewah)
enable_testing()
add_subdirectory(tests)
add_subdirectory(examples)
add_subdirectory(benchmarks)
install(
TARGETS ewah
EXPORT ewahTargets
RUNTIME COMPONENT ewah_Runtime
LIBRARY COMPONENT ewah_Runtime
ARCHIVE COMPONENT ewah_Development
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
configure_file(cmake/ewah-config.cmake.in ewah-config.cmake @ONLY)
write_basic_package_version_file(
ewah-config-version.cmake
COMPATIBILITY SameMinorVersion
)
set(
EWAH_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/ewah"
CACHE STRING "CMake package config location relative to the install prefix"
)
mark_as_advanced(EWAH_INSTALL_CMAKEDIR)
install(
FILES
"${PROJECT_BINARY_DIR}/ewah-config.cmake"
"${PROJECT_BINARY_DIR}/ewah-config-version.cmake"
DESTINATION "${EWAH_INSTALL_CMAKEDIR}"
COMPONENT ewah_Development
)
message(STATUS "CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}")
# pkg-config
include(cmake/JoinPaths.cmake)
join_paths(PKGCONFIG_INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
join_paths(PKGCONFIG_LIBDIR "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
configure_file("ewah.pc.in" "ewah.pc" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/ewah.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/ewah" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(TARGETS ewah
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(
EXPORT ewahTargets
NAMESPACE ewah::
DESTINATION "${EWAH_INSTALL_CMAKEDIR}"
COMPONENT example_Development
)
#
# CPack
#
if(is_top_project)
set(CPACK_PACKAGE_VENDOR "Daniel Lemire")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RPM_PACKAGE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
include(CPack)
endif()