-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
40 lines (36 loc) · 1.2 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
############################# INITIAL SECTION #############################################
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
project(hpenc CXX)
set(HPENC_VERSION "3.0")
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
else ()
set (CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
endmacro(use_cxx11)
use_cxx11()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(sodium REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
include_directories("${OPENSSL_INCLUDE_DIR}")
include_directories("${sodium_INCLUDE_DIR}")
list(APPEND LIBS "${sodium_LIBRARY_RELEASE}")
list(APPEND LIBS "${OPENSSL_LIBRARIES}")
set(SOURCES "src/aead.cc"
"src/decrypt.cc"
"src/encrypt.cc"
"src/kdf.cc"
"src/main.cc"
"src/nonce.cc"
"src/util.cc")
add_executable(hpenc ${SOURCES})
target_link_libraries(hpenc ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(hpenc ${LIBS})
set_target_properties(hpenc PROPERTIES VERSION ${HPENC_VERSION})
install(TARGETS hpenc DESTINATION bin)