forked from ElementsProject/libwally-core
-
Notifications
You must be signed in to change notification settings - Fork 4
/
_CMakeLists.txt
61 lines (49 loc) · 1.47 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
cmake_minimum_required(VERSION 3.20)
project(
libwallycore
VERSION 0.9.2
DESCRIPTION "A collection of useful primitives for cryptocurrency wallets"
LANGUAGES C
)
option(BUILD_SHARED_LIBS "Build as shared library" OFF)
include(cmake/utils.cmake)
generate_config_file()
configure_file(src/ccan_config.h ccan_config.h COPYONLY)
include(cmake/libsecp256k1.cmake)
add_subdirectory(src)
### install directives
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(LIB_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/wallycore)
configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/wallycore-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config.cmake"
INSTALL_DESTINATION ${LIB_CMAKE_INSTALL_DIR}
PATH_VARS LIB_CMAKE_INSTALL_DIR
)
write_basic_package_version_file(
wallycore-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config-version.cmake"
DESTINATION
${LIB_CMAKE_INSTALL_DIR}
)
install(
TARGETS wallycore
EXPORT "wallycore-target"
COMPONENT wallycore
RUNTIME EXCLUDE_FROM_ALL
OBJECTS EXCLUDE_FROM_ALL
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT "wallycore-target"
DESTINATION ${LIB_CMAKE_INSTALL_DIR}
NAMESPACE wallycore::
FILE "wallycore-targets.cmake"
)