-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
63 lines (51 loc) · 1.82 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.23)
# Add etc/cmake to CMake's search path so we can put our private stuff there
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/etc/cmake)
include(version)
project(libleidenalg VERSION ${PACKAGE_VERSION_BASE})
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(packaging)
find_package(igraph 0.10 CONFIG REQUIRED)
# Set C++ standard version
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set default symbol visibility to hidden
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# Expose the BUILD_SHARED_LIBS option in the ccmake UI
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
add_subdirectory(src)
add_subdirectory(include)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/libleidenalgConfig.cmake.in"
"${PROJECT_BINARY_DIR}/libleidenalgConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libleidenalg"
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/libleidenalgConfigVersion.cmake"
COMPATIBILITY SameMinorVersion)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/libleidenalgConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/libleidenalgConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libleidenalg"
COMPONENT dev
)
export(
TARGETS libleidenalg
FILE "${PROJECT_BINARY_DIR}/libleidenalgTargets.cmake")
export(PACKAGE libleidenalg)
install(
TARGETS libleidenalg
EXPORT libleidenalgTargets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
FILE_SET headers
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libleidenalg" COMPONENT dev
)
install(
EXPORT libleidenalgTargets
FILE libleidenalgTargets.cmake
NAMESPACE libleidenalg::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libleidenalg"
)