forked from spotify/annoy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
33 lines (24 loc) · 917 Bytes
/
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
cmake_minimum_required(VERSION 3.15...3.25 FATAL_ERROR)
project(Annoy
DESCRIPTION "Approximate Nearest Neighbors Oh Yeah"
VERSION 1.17.1
LANGUAGES CXX)
add_library(Annoy INTERFACE)
add_library(Annoy::Annoy ALIAS Annoy)
foreach (HEADER annoylib.h kissrandom.h mman.h)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/${HEADER}" "${CMAKE_CURRENT_BINARY_DIR}/include/annoy/${HEADER}" COPYONLY)
endforeach ()
target_include_directories(Annoy INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
# Install
include(GNUInstallDirs)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS Annoy
EXPORT AnnoyTargets)
install(EXPORT AnnoyTargets
FILE AnnoyConfig.cmake
NAMESPACE Annoy::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/annoy)
export(TARGETS Annoy NAMESPACE Annoy:: FILE AnnoyConfig.cmake)