-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (36 loc) · 1.34 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
cmake_minimum_required(VERSION 2.8.3)
project(ANN)
option(BUILD_SAMPLE "option for build sample" OFF)
option(BUILD_TEST "option for build test" OFF)
option(BUILD_ANN2FIG "option for build ann to fig" OFF)
option(BUILD_DBSCAN_SAMPLE "option for build dbsan sample" OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -O3 -g")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
)
file(GLOB SOUREC "src/*.cpp")
add_library(ANN SHARED ${SOUREC} )
if(${BUILD_SAMPLE})
set(SAMPLE "sample/ann_sample.cpp")
add_executable(sample ${SAMPLE})
target_link_libraries(sample ANN)
endif()
if(${BUILD_TEST})
file(GLOB TEST_SRC "test/*.cpp")
add_executable(ann_test ${TEST_SRC})
target_link_libraries(ann_test ANN)
endif()
if(${BUILD_ANN2FIG})
file(GLOB ANN2FIG_SRC "ann2fig/*.cpp")
add_executable(ann2fig ${ANN2FIG_SRC})
target_link_libraries(ann2fig ANN)
endif()
if(${BUILD_DBSCAN_SAMPLE})
set(DBSCAN_SRC "sample/dbscan_sample.cpp")
add_executable(dbscan ${DBSCAN_SRC})
target_link_libraries(dbscan ANN)
endif()