2014-04-07 02:27:06 +05:30
|
|
|
project (ndhc)
|
2010-11-12 15:14:25 +05:30
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
|
2014-03-31 02:32:48 +05:30
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DNK_USE_CAPABILITY")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -Wall -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -lrt -lcap -D_GNU_SOURCE -DNK_USE_CAPABILITY")
|
2010-11-12 15:14:25 +05:30
|
|
|
|
2014-03-22 09:22:15 +05:30
|
|
|
if (WIN32)
|
|
|
|
set(OSNAME "Win32")
|
|
|
|
else()
|
|
|
|
execute_process(
|
|
|
|
COMMAND uname
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE OSNAME
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT (${OSNAME} STREQUAL "Linux"))
|
|
|
|
message("ndhc requires Linux. Patches are welcome. Consult README.")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND uname -m
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE MACHINENAME
|
|
|
|
)
|
|
|
|
|
|
|
|
if (${MACHINENAME} STREQUAL "x86_64")
|
|
|
|
message("Detected that the current host is x86_64. Enabling seccomp-filter.")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SECCOMP_FILTER")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_SECCOMP_FILTER")
|
|
|
|
elseif ((${MACHINENAME} STREQUAL "i686") OR (${MACHINENAME} STREQUAL "i586") OR
|
|
|
|
(${MACHINENAME} STREQUAL "i486") OR (${MACHINENAME} STREQUAL "i386"))
|
|
|
|
message("Detected that the current host is x86. Enabling seccomp-filter.")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SECCOMP_FILTER")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_SECCOMP_FILTER")
|
|
|
|
else()
|
|
|
|
message("Host machine type does not support seccomp-filter.")
|
|
|
|
endif()
|
|
|
|
|
2014-03-10 10:22:56 +05:30
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/ncmlib")
|
2010-11-12 16:12:07 +05:30
|
|
|
add_subdirectory(ncmlib)
|
2010-11-12 15:14:25 +05:30
|
|
|
|
2014-04-07 02:27:06 +05:30
|
|
|
add_subdirectory(src)
|