File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed
Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 2.6)
2- project (hnsw_lib
1+ cmake_minimum_required (VERSION 3.0...3.26)
2+
3+ project (hnswlib
34 LANGUAGES CXX)
45
6+ include (GNUInstallDirs)
7+
58add_library (hnswlib INTERFACE )
6- target_include_directories (hnswlib INTERFACE .)
9+ add_library (hnswlib::hnswlib ALIAS hnswlib)
10+
11+ target_include_directories (hnswlib INTERFACE
12+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >
13+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >)
14+
15+ # Install
16+ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /hnswlib
17+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
718
19+ install (TARGETS hnswlib
20+ EXPORT hnswlibTargets)
21+
22+ install (EXPORT hnswlibTargets
23+ FILE hnswlibConfig.cmake
24+ NAMESPACE hnswlib::
25+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/hnswlib)
26+
27+ # Examples and tests
828if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
29+ option (HNSWLIB_EXAMPLES "Build examples and tests." ON )
30+ else ()
31+ option (HNSWLIB_EXAMPLES "Build examples and tests." OFF )
32+ endif ()
33+ if (HNSWLIB_EXAMPLES)
934 set (CMAKE_CXX_STANDARD 11)
1035
1136 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
You can’t perform that action at this time.
0 commit comments