-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
55 lines (41 loc) · 1.18 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
50
51
52
53
54
cmake_minimum_required(VERSION 2.4)
set(cmake_allow_loose_loop_constructs 1)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif()
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libev)
INCLUDE_DIRECTORIES("/usr/include/node")
ADD_LIBRARY(snmp_binding MODULE
src/snmp_binding.cc
)
IF(NOT DEFINED CONF_SYNC)
SET(CONF_SYNC false
CACHE BOOL "build synchronous interface (requires custom node.js)" FORCE
)
ENDIF()
IF(NOT DEFINED NODE_ROOT)
SET(NODE_ROOT "/usr/local"
CACHE STRING "where to look for node.js include files" FORCE)
ENDIF()
ADD_DEFINITIONS(
# -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
# -D_GNU_SOURCE
-DEV_STANDALONE=1
)
IF(CONF_SYNC)
ADD_DEFINITIONS(-DEV_MULTIPLICITY=1)
ELSE()
ADD_DEFINITIONS(-DEV_MULTIPLICITY=0)
ENDIF()
INCLUDE_DIRECTORIES("${NODE_ROOT}/include/node")
# these are needed when node has not been installed yet. Highly unusual situation.
#INCLUDE_DIRECTORIES("${NODE_ROOT}/deps/libev")
#INCLUDE_DIRECTORIES("${NODE_ROOT}/deps/v8/src")
#INCLUDE_DIRECTORIES("${NODE_ROOT}/deps/libeio")
#INCLUDE_DIRECTORIES("${NODE_ROOT}/src")
SET_TARGET_PROPERTIES(snmp_binding PROPERTIES
PREFIX "" SUFFIX ".node")
TARGET_LINK_LIBRARIES(snmp_binding
netsnmp
)