-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project (CRYPTOGRAPHIC_LIB) | ||
|
||
set (crypto_VERSION_MAJOR 1) | ||
set (crypto_VERSION_MINOR 0) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif(NOT CMAKE_BUILD_TYPE) | ||
|
||
if(CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "Release") | ||
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") | ||
else() | ||
message(FATAL_ERROR "CMake build type \"${CMAKE_BUILD_TYPE}\" is not supported") | ||
endif() | ||
|
||
include (CheckCXXCompilerFlag) | ||
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14) | ||
if(COMPILER_SUPPORTS_CXX14) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") | ||
else() | ||
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. | ||
Please use a different C++ compiler.") | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX) | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Werror -Wextra") | ||
set (CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 -fno-omit-frame-pointer -DDEBUG") | ||
set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") | ||
endif(CMAKE_COMPILER_IS_GNUCXX) | ||
|
||
include (CheckIncludeFileCXX) | ||
CHECK_INCLUDE_FILE_CXX ("gsl/span" HAVE_GSL_SPAN) | ||
if(NOT HAVE_GSL_SPAN) | ||
message(FATAL_ERROR "gsl library: <gsl/span> not found") | ||
endif() | ||
|
||
message(STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR}) | ||
|
||
add_subdirectory (src) | ||
add_subdirectory (test) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project (crypto-all) | ||
|
||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../include") | ||
|
||
set (SRC_FILES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/MD4.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/MD5.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/SHA1.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/SHA224.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/SHA256.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/SHA384.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/SHA512.cpp" | ||
) | ||
|
||
add_library (crypto_static STATIC ${SRC_FILES}) | ||
add_library (crypto SHARED ${SRC_FILES}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project (test-crypto) | ||
|
||
find_package (GTest REQUIRED) | ||
include_directories (${GTEST_INCLUDE_DIRS}) | ||
|
||
set(THREADS_PREFER_PTHREAD_FLAG on) | ||
find_package (Threads REQUIRED) | ||
|
||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../include") | ||
|
||
find_library (CRYPTO_LIBRARY | ||
NAMES crypto #crypto_static | ||
HINTS "${CMAKE_CURRENT_SOURCE_DIR}/../src" | ||
) | ||
|
||
link_directories("${CMAKE_CURRENT_BINARY_DIR}/../src") | ||
|
||
set (SRC_FILES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/test_libcrypto.cpp" | ||
) | ||
|
||
add_executable (test-crypto ${SRC_FILES}) | ||
target_link_libraries (test-crypto | ||
pthread | ||
${GTEST_BOTH_LIBRARIES} | ||
#crypto_static | ||
crypto | ||
) | ||
|
||
include (CTest) | ||
add_test (unit_tests "${CMAKE_CURRENT_BINARY_DIR}/test-crypto") |
This file was deleted.
Oops, something went wrong.