2015-12-05 22:50:00 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
2019-07-20 18:10:36 +02:00
|
|
|
# set meta data
|
|
|
|
project(passwordfile)
|
|
|
|
set(META_PROJECT_NAME ${PROJECT_NAME})
|
|
|
|
set(META_PROJECT_VARNAME PASSWORD_FILE)
|
|
|
|
set(META_APP_NAME "Passwordfile library")
|
|
|
|
set(META_APP_AUTHOR "Martchus")
|
|
|
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
|
|
|
set(META_APP_DESCRIPTION "C++ library to read/write passwords from/to encrypted files")
|
|
|
|
set(META_VERSION_MAJOR 5)
|
|
|
|
set(META_VERSION_MINOR 0)
|
2022-03-15 21:40:17 +01:00
|
|
|
set(META_VERSION_PATCH 8)
|
2019-07-20 18:10:36 +02:00
|
|
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
|
|
|
|
2015-12-08 08:36:00 +01:00
|
|
|
# add project files
|
|
|
|
set(HEADER_FILES
|
|
|
|
io/cryptoexception.h
|
|
|
|
io/entry.h
|
|
|
|
io/field.h
|
|
|
|
io/parsingexception.h
|
|
|
|
io/passwordfile.h
|
|
|
|
util/openssl.h
|
2019-02-06 18:02:40 +01:00
|
|
|
util/opensslrandomdevice.h)
|
2015-12-08 08:36:00 +01:00
|
|
|
set(SRC_FILES
|
|
|
|
io/cryptoexception.cpp
|
|
|
|
io/entry.cpp
|
|
|
|
io/field.cpp
|
|
|
|
io/parsingexception.cpp
|
|
|
|
io/passwordfile.cpp
|
|
|
|
util/openssl.cpp
|
2019-02-06 18:02:40 +01:00
|
|
|
util/opensslrandomdevice.cpp)
|
|
|
|
set(TEST_HEADER_FILES)
|
2019-12-15 19:45:47 +01:00
|
|
|
set(TEST_SRC_FILES tests/utils.h tests/passwordfiletests.cpp tests/entrytests.cpp tests/fieldtests.cpp
|
|
|
|
tests/opensslrandomdevice.cpp tests/opensslutils.cpp)
|
2015-12-08 08:36:00 +01:00
|
|
|
|
2019-02-06 18:02:40 +01:00
|
|
|
set(DOC_FILES README.md)
|
2016-06-10 23:18:21 +02:00
|
|
|
|
2021-08-22 00:17:04 +02:00
|
|
|
option(COMPILE_AES_SOURCES "compile AES sources" OFF)
|
|
|
|
if (COMPILE_AES_SOURCES)
|
|
|
|
list(APPEND HEADER_FILES aes/aes.h)
|
|
|
|
list(APPEND SRC_FILES aes/aes.cpp)
|
|
|
|
endif ()
|
|
|
|
|
2016-04-16 00:51:17 +02:00
|
|
|
# find c++utilities
|
2019-12-15 19:45:47 +01:00
|
|
|
set(CONFIGURATION_PACKAGE_SUFFIX
|
|
|
|
""
|
2019-03-13 19:08:30 +01:00
|
|
|
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
|
|
|
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
|
|
|
use_cpp_utilities(VISIBILITY PUBLIC)
|
2016-04-16 00:51:17 +02:00
|
|
|
|
2016-07-22 01:36:23 +02:00
|
|
|
# find 3rd party libraries
|
|
|
|
include(3rdParty)
|
2019-03-13 19:08:30 +01:00
|
|
|
use_zlib()
|
|
|
|
use_crypto()
|
2016-04-16 00:51:17 +02:00
|
|
|
|
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
|
|
|
include(TestTarget)
|
2016-06-10 23:18:21 +02:00
|
|
|
include(Doxygen)
|
2016-07-27 21:40:22 +02:00
|
|
|
include(ConfigHeader)
|