-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
33 lines (26 loc) · 858 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.2)
project(libkdtree)
set(CMAKE_CXX_STANDARD 11)
# Find OpenMP
IF (APPLE)
message(STATUS "clang does not support OpenMP!")
ELSEIF (WIN32 OR UNIX)
find_package(OpenMP REQUIRED)
IF(OPENMP_FOUND)
message(STATUS "OpenMP Found!")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
ENDIF()
ENDIF ()
# Libkdtree source files
set(SOURCE_FILES src/kdtree.cpp src/kdtree.h)
# A demo
set(DEMO_FILES demo.cpp)
# Build libkdtree
add_library(kdtree SHARED ${SOURCE_FILES})
# Build demo
add_executable(demo ${DEMO_FILES})
set_target_properties(kdtree PROPERTIES LINKER_LANGUAGE C)
# Link lib and demo
target_link_libraries(demo kdtree)