|
|
@ -11,12 +11,18 @@ option(WITH_HARDENING "Enable hardening options" ON) |
|
|
|
if (NOT DEFINED CMAKE_INSTALL_PREFIX) |
|
|
|
if (NOT DEFINED CMAKE_INSTALL_PREFIX) |
|
|
|
set(CMAKE_INSTALL_PREFIX "/usr") |
|
|
|
set(CMAKE_INSTALL_PREFIX "/usr") |
|
|
|
endif () |
|
|
|
endif () |
|
|
|
set(INSTALL_LIB "${CMAKE_INSTALL_PREFIX}/lib/openvpn") |
|
|
|
# HACK: cmake >= 3.4 fixes this |
|
|
|
|
|
|
|
if (CMAKE_INSTALL_PREFIX MATCHES "^/usr/?$") |
|
|
|
|
|
|
|
set(CMAKE_INSTALL_SYSCONFDIR "/etc") |
|
|
|
|
|
|
|
set(CMAKE_INSTALL_LOCALSTATEDIR "/var") |
|
|
|
|
|
|
|
endif () |
|
|
|
|
|
|
|
|
|
|
|
list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic") |
|
|
|
include(GNUInstallDirs) |
|
|
|
|
|
|
|
|
|
|
|
find_library(LIBLDAP NAMES "ldap") |
|
|
|
find_library(LIBLDAP NAMES "ldap") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic") |
|
|
|
|
|
|
|
|
|
|
|
if (WITH_HARDENING) |
|
|
|
if (WITH_HARDENING) |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security -Werror=format-security" ) |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security -Werror=format-security" ) |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector --param ssp-buffer-size=4" ) |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector --param ssp-buffer-size=4" ) |
|
|
@ -25,11 +31,12 @@ endif () |
|
|
|
|
|
|
|
|
|
|
|
message(STATUS "------------------------------------------") |
|
|
|
message(STATUS "------------------------------------------") |
|
|
|
message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") |
|
|
|
message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") |
|
|
|
message(STATUS "") |
|
|
|
message(STATUS "Paths:") |
|
|
|
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") |
|
|
|
message(STATUS "- prefix: ${CMAKE_INSTALL_PREFIX}") |
|
|
|
message(STATUS "Library directory: ${INSTALL_LIB}") |
|
|
|
message(STATUS "- binary: ${CMAKE_INSTALL_FULL_BINDIR}") |
|
|
|
message(STATUS "") |
|
|
|
message(STATUS "- library: ${CMAKE_INSTALL_FULL_LIBDIR}") |
|
|
|
message(STATUS "ldap: ${LIBLDAP}") |
|
|
|
message(STATUS "Libraries:") |
|
|
|
|
|
|
|
message(STATUS "- ldap: ${LIBLDAP}") |
|
|
|
|
|
|
|
|
|
|
|
add_subdirectory (src) |
|
|
|
add_subdirectory (src) |
|
|
|
add_subdirectory (tests) |
|
|
|
add_subdirectory (tests) |
|
|
|