-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (24 loc) · 914 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 2.6)
PROJECT(urngd)
INCLUDE(GNUInstallDirs)
INCLUDE (FindPkgConfig)
SET(URNGD_VERSION 1.0.1)
SET(JTEN_DIR 3rdparty/jitterentropy-rngd)
FIND_PATH(ubox_include_dir NAMES libubox/usock.h)
FIND_LIBRARY(ubox NAMES ubox)
INCLUDE_DIRECTORIES(${ubox_include_dir} ${JTEN_DIR})
SET(CMAKE_C_FLAGS_DEBUG -DURNGD_DEBUG)
ADD_DEFINITIONS(-Wall -Werror -Wextra --std=gnu99 -DURNGD_VERSION="${URNGD_VERSION}")
ADD_DEFINITIONS(-Wno-unused-parameter)
ADD_EXECUTABLE(urngd
urngd.c
${JTEN_DIR}/jitterentropy-base.c
)
TARGET_LINK_LIBRARIES(urngd ${ubox})
# jitter RNG must not be compiled with optimizations
SET_SOURCE_FILES_PROPERTIES(${JTEN_DIR}/jitterentropy-base.c PROPERTIES COMPILE_FLAGS -O0)
INSTALL(TARGETS urngd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
SET(REMOTE_ADDR 192.168.1.20)
ADD_CUSTOM_TARGET(upload
COMMAND scp ${CMAKE_BINARY_DIR}/urngd root@${REMOTE_ADDR}:/usr/sbin
)