summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-09-03 21:40:34 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-09-03 21:40:34 +0400
commit9739251101bffde2c62ba08c1869eb170d952d5b (patch)
tree41f59ad7a2c6fc855404f808cba887d88a32c96a /CMakeLists.txt
parent44adc2a544ea23aee39105b048c8f90cef565a5b (diff)
downloadaccel-ppp-9739251101bffde2c62ba08c1869eb170d952d5b.tar.gz
accel-ppp-9739251101bffde2c62ba08c1869eb170d952d5b.zip
implemented crypto library selection: -DCRYPTO=OPENSSL|TOMCRYPT|INTERNAL (default OPENSSL)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 25 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40f2f1ad..78ff7ad0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,15 +2,37 @@ cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0003 OLD)
-PROJECT (accel-ppp C)
+project(accel-ppp C)
include(cmake/cpack.cmake)
if (NOT BUILD_DRIVER_ONLY)
- ADD_SUBDIRECTORY(accel-pppd)
+ if (MEMDEBUG)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector -fstack-protector-all")
+ endif (MEMDEBUG)
+
+ if (NOT DEFINED CRYPTO)
+ set(CRYPTO OPENSSL)
+ endif (NOT DEFINED CRYPTO)
+
+ if (CRYPTO STREQUAL OPENSSL)
+ add_definitions(-DCRYPTO_OPENSSL)
+ set(crypto_lib crypto)
+ elseif (CRYPTO STREQUAL TOMCRYPT)
+ add_definitions(-DCRYPTO_TOMCRYPT)
+ set(crypto_lib tomcrypt)
+ elseif (CRYPTO STREQUAL INTERNAL)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/crypto)
+ set(crypto_lib internal-crypto)
+ else (CRYPTO STREQUAL OPENSSL)
+ message(FATAL_ERROR "unknown CRYPTO type")
+ endif (CRYPTO STREQUAL OPENSSL)
+
+ add_subdirectory(accel-pppd)
+ add_subdirectory(crypto)
endif (NOT BUILD_DRIVER_ONLY)
if (BUILD_DRIVER OR BUILD_DRIVER_ONLY)
- ADD_SUBDIRECTORY(driver)
+ add_subdirectory(driver)
endif (BUILD_DRIVER OR BUILD_DRIVER_ONLY)