-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
37 lines (28 loc) · 1.27 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
cmake_minimum_required(VERSION 2.8)
set(SIFT sift)
project(${SIFT})
option(SIFT_BUILD_EXAMPLES "Build with examples" ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
endforeach()
set(SIFT_ROOT ${PROJECT_SOURCE_DIR}/)
set(SIFT_SRC_DIR ${SIFT_ROOT}/src)
file(GLOB_RECURSE SRC RELATIVE ${PROJECT_SOURCE_DIR} "${SIFT_SRC_DIR}/*.cpp")
file(GLOB_RECURSE HEADERS RELATIVE ${PROJECT_SOURCE_DIR} "${SIFT_SRC_DIR}/*.h")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(${SIFT} ${SRC})
set_property(TARGET ${SIFT} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(${SIFT} PUBLIC ${SIFT_SRC_DIR})
if(SIFT_BUILD_EXAMPLES)
file(GLOB_RECURSE MATCH_SRC "image_match.cpp")
add_executable(image_match ${MATCH_SRC})
target_link_libraries(image_match
sift
)
endif()