-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
41 lines (32 loc) · 898 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
34
35
36
37
38
39
40
41
include(CheckIncludeFiles)
cmake_minimum_required(VERSION 2.8.12)
# project name
project(movr)
# global options
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
# source files of this project
set(movr_SRCS
src/flowmap.c
src/order.c
src/order.h
)
set(SOURCES ${movr_SRCS})
# find external libraries
find_package(R REQUIRED)
find_package(GLIB REQUIRED)
# add external libraries
set(LIBS ${LIBS} ${R_LIBRARIES})
set(LIBS ${LIBS} ${GLIB_LIBRARIES})
# add header file dir
include_directories (
${R_INCLUDE_DIR}
${GLIB_INCLUDE_DIRS}
)
# generate a shared library
add_library(${CMAKE_PROJECT_NAME} SHARED ${SOURCES})
target_link_libraries(${CMAKE_PROJECT_NAME} ${LIBS})
# install library to custom location
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION lib)