-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (36 loc) · 1.14 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
47
48
49
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0091 NEW)
project(node_btree
VERSION 0.9.0
LANGUAGES C)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_C_STANDARD_REQUIRED ON)
include(CheckCPUFlags)
include(BuildConfig)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
add_link_options(-undefined dynamic_lookup)
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/build/${CMAKE_BUILD_TYPE})
if(NOT DEFINED CMAKE_JS_INC)
message(STATUS "CMAKE_JS_INC is not direct defined.")
if(DEFINED ENV{CMAKE_JS_INC})
message(STATUS "Pass CMAKE_JS_INC from env.")
set(CMAKE_JS_INC $ENV{CMAKE_JS_INC})
endif()
if(NOT CMAKE_JS_INC)
message(
FATAL_ERROR
"CMAKE_JS_INC is not defined. Try checking your CMake.js configuration.")
endif()
endif()
message(STATUS "CMAKE_JS_INC: ${CMAKE_JS_INC}")
include_directories(${CMAKE_JS_INC})
add_subdirectory(src)
enable_testing()
set(COVERAGE_LINES_PERCENT 90)
add_test(
NAME coverage
COMMAND "gcovr" "-sp" "-r" ".." "--print-summary" "--fail-under-line" ${COVERAGE_LINES_PERCENT} ".")