Skip to content

Commit 4bb499c

Browse files
Merge branch 'opendnssec:develop' into fix_issue_655
2 parents eae8f5f + f4661af commit 4bb499c

82 files changed

Lines changed: 1481 additions & 252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appveyor.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,42 @@ init:
4141
$env:RELEASE_DIR=Join-Path $env:BUILD_DIR "SoftHSMv2-$env:ENV_PLATFORM"
4242
4343
$env:CONFIGURE_OPTIONS = "$env:CONFIGURE_OPTIONS with-crypto-backend=$env:CRYPTO_BACKEND with-$env:CRYPTO_BACKEND=$env:CRYPTO_PACKAGE_PATH\ with-cppunit=$env:CPPUNIT_PATH\"
44+
cache:
45+
- C:/Tools/vcpkg/installed/
4446
environment:
47+
APPVEYOR_SAVE_CACHE_ON_ERROR: true
4548
matrix:
46-
- CRYPTO_BACKEND: botan
47-
ADDITIONAL_CONFIGURE_OPTIONS: disable-eddsa disable-gost with-crypto-backend=botan
4849
- CRYPTO_BACKEND: openssl
4950
ADDITIONAL_CONFIGURE_OPTIONS: disable-eddsa disable-gost with-crypto-backend=openssl
51+
DB_BACKEND: OFF
52+
- CRYPTO_BACKEND: openssl
53+
ADDITIONAL_CONFIGURE_OPTIONS: disable-eddsa disable-gost with-crypto-backend=openssl
54+
DB_BACKEND: ON
55+
- CRYPTO_BACKEND: botan
56+
ADDITIONAL_CONFIGURE_OPTIONS: disable-eddsa disable-gost with-crypto-backend=botan
57+
DB_BACKEND: OFF
5058
install:
59+
# Update vcpkg
60+
- cd c:\tools\vcpkg
61+
- cmd: git fetch
62+
- cmd: bootstrap-vcpkg.bat
63+
- cmd: vcpkg update
64+
- cmd: vcpkg upgrade --no-dry-run
5165
- cmd: vcpkg install sqlite3:x86-windows
66+
- cmd: vcpkg install openssl-windows:x86-windows
5267
- cmd: vcpkg install openssl-windows:x64-windows
5368
- cmd: vcpkg install botan:x86-windows
5469
- cmd: vcpkg install cppunit:x86-windows
55-
- cmd: vcpkg install getopt-win32:x86-windows
56-
build_script:
5770
- cmd: vcpkg integrate install
58-
- cmd: cmake -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DWITH_CRYPTO_BACKEND=%CRYPTO_BACKEND% -DBUILD_TESTS=OFF -DDISABLE_NON_PAGED_MEMORY=ON -DENABLE_GOST=OFF .
59-
- cmd: msbuild softhsm2.sln /p:Configuration="Release" /p:Platform="Win32" /p:PlatformToolset=v140 /target:Build
71+
build_script:
72+
- cmd: if exist "C:\projects\softhsmv2\build" rmdir /s /q C:\projects\softhsmv2\build
73+
- cmd: mkdir C:\projects\softhsmv2\build
74+
- cmd: cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DWITH_OBJECTSTORE_BACKEND_DB=%DB_BACKEND% -DWITH_CRYPTO_BACKEND=%CRYPTO_BACKEND% -DBUILD_TESTS=ON -DDISABLE_NON_PAGED_MEMORY=ON -DENABLE_GOST=OFF
75+
- cmd: cmake -Bbuild --build . --config RelWithDebInfo
76+
- cmd: ctest -Bbuild -C RelWithDebInfo --progress --verbose
77+
- cmd: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=build/SoftHSMv2-$(Platform) -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo -P cmake_install.cmake
6078
- cmd: IF "%ENV_PLATFORM%"=="x86" ( CD win32\Release ) ELSE ( CD win32\x64\Release)
61-
- cmd: cryptotest.exe
62-
- cmd: datamgrtest.exe
63-
- cmd: handlemgrtest.exe
64-
- cmd: objstoretest.exe
65-
- cmd: p11test.exe
66-
- cmd: sessionmgrtest.exe
67-
- cmd: slotmgrtest.exe
68-
test: off
79+
test: on
6980
artifacts:
7081
- path: build/SoftHSMv2-$(Platform)
7182
name: SoftHSMv2-$(PACKAGE_VERSION_NAME)-$(Platform)

CMAKE-WIN-NOTES.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Building SoftHSMv2 for Windows
2+
3+
This document describes process of building both 32-bit and 64-bit versions of SoftHSMv2.
4+
5+
## Required software
6+
7+
- [Visual Studio](https://visualstudio.microsoft.com/vs/community/) (Community)
8+
- [C/C++ dependency manager from Microsoft](https://vcpkg.io/)
9+
- [CMake](https://cmake.org/)
10+
11+
## Prepare working directories
12+
13+
set VCPKG_HOME=C:\Projects\vcpkg
14+
set SOFTHSM_HOME=C:\Projects\SoftHSMv2
15+
git clone https://github.com/opendnssec/SoftHSMv2.git %SOFTHSM_HOME%
16+
git clone https://github.com/Microsoft/vcpkg.git %VCPKG_HOME%
17+
18+
## Build dependencies
19+
20+
cd %VCPKG_HOME%
21+
bootstrap-vcpkg.bat
22+
git fetch
23+
git checkout 2021.05.12
24+
25+
vcpkg install cppunit:x86-windows
26+
vcpkg install cppunit:x86-windows-static
27+
vcpkg install openssl-windows:x86-windows
28+
vcpkg install botan:x86-windows
29+
vcpkg install sqlite3:x86-windows
30+
31+
vcpkg install cppunit:x64-windows
32+
vcpkg install cppunit:x64-windows-static
33+
vcpkg install openssl-windows:x64-windows
34+
vcpkg install botan:x64-windows
35+
vcpkg install sqlite3:x64-windows
36+
37+
vcpkg integrate install
38+
39+
## Configure SoftHSMv2
40+
41+
Build can be configured using the following commands:
42+
43+
mkdir %SOFTHSM_HOME%\tmp32
44+
cd %SOFTHSM_HOME%\tmp32
45+
cmake .. -G "Visual Studio 15 2017" -A Win32 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DCMAKE_INSTALL_PREFIX=%SOFTHSM_HOME%\out32 -DBUILD_TESTS=ON -DWITH_CRYPTO_BACKEND=openssl -DWITH_OBJECTSTORE_BACKEND_DB=OFF
46+
47+
mkdir %SOFTHSM_HOME%\tmp64
48+
cd %SOFTHSM_HOME%\tmp64
49+
cmake .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_HOME%\scripts\buildsystems\vcpkg.cmake -DCMAKE_INSTALL_PREFIX=%SOFTHSM_HOME%\out64 -DBUILD_TESTS=ON -DWITH_CRYPTO_BACKEND=botan -DWITH_OBJECTSTORE_BACKEND_DB=ON
50+
51+
Some options (more can be found in CMakeLists.txt):
52+
53+
-DBUILD_TESTS=ON Compile tests along with libraries
54+
-DENABLE_EDDSA=ON Enable support for EDDSA
55+
-DWITH_MIGRATE=ON Build migration tool
56+
-DWITH_CRYPTO_BACKEND= Select crypto backend (openssl|botan)
57+
-DDISABLE_NON_PAGED_MEMORY=ON Disable non-paged memory for secure storage
58+
-DWITH_OBJECTSTORE_BACKEND_DB=ON Enable sqlite3 data storage
59+
60+
## Compile
61+
62+
Compile the source code using the following command:
63+
64+
cmake --build . --config RelWithDebInfo
65+
66+
## Test
67+
68+
ctest -C RelWithDebInfo --output-on-failure --progress --verbose
69+
70+
## Install
71+
72+
Install the library using the follow command:
73+
74+
cmake -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo -P cmake_install.cmake

CMakeLists.txt

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
2-
1+
cmake_minimum_required(VERSION 3.16)
32
project(softhsm2 C CXX)
43

54
# Build Options
@@ -8,8 +7,8 @@ option(DISABLE_NON_PAGED_MEMORY "Disable non-paged memory for secure storage" OF
87
option(DISABLE_VISIBILITY "Disables and unsets -fvisibility=hidden" OFF)
98
option(ENABLE_64bit "Enable 64-bit compiling" OFF)
109
option(ENABLE_ECC "Enable support for ECC" ON)
11-
option(ENABLE_EDDSA "Enable support for EDDSA" OFF)
12-
option(ENABLE_GOST "Enable support for GOST" ON)
10+
option(ENABLE_EDDSA "Enable support for EDDSA" ON)
11+
option(ENABLE_GOST "Enable support for GOST" OFF)
1312
option(ENABLE_FIPS "Enable support for FIPS 140-2 mode" OFF)
1413
option(ENABLE_P11_KIT "Enable p11-kit integration" ON)
1514
option(ENABLE_PEDANTIC "Enable pedantic compile mode" OFF)
@@ -80,11 +79,37 @@ if(NOT CMAKE_BUILD_TYPE)
8079
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Default build type for SoftHSMv2 project" FORCE)
8180
endif(NOT CMAKE_BUILD_TYPE)
8281

82+
83+
set(CMAKE_CXX_FLAGS_MAINTAINER "-Wall -Wabi" CACHE STRING
84+
"Flags used by the C++ compiler during maintainer builds."
85+
FORCE)
86+
set(CMAKE_C_FLAGS_MAINTAINER "-Wall -pedantic" CACHE STRING
87+
"Flags used by the C compiler during maintainer builds."
88+
FORCE)
89+
set(CMAKE_EXE_LINKER_FLAGS_MAINTAINER
90+
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
91+
"Flags used for linking binaries during maintainer builds."
92+
FORCE)
93+
set(CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
94+
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
95+
"Flags used by the shared libraries linker during maintainer builds."
96+
FORCE)
97+
mark_as_advanced(
98+
CMAKE_CXX_FLAGS_MAINTAINER
99+
CMAKE_C_FLAGS_MAINTAINER
100+
CMAKE_EXE_LINKER_FLAGS_MAINTAINER
101+
CMAKE_SHARED_LINKER_FLAGS_MAINTAINER)
102+
103+
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
104+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Maintainer."
105+
FORCE)
106+
107+
83108
message(STATUS "Build Configuration: ${CMAKE_BUILD_TYPE}")
84109

85110
# Build Modules Path
86111
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
87-
${CMAKE_SOURCE_DIR}/modules
112+
${CMAKE_SOURCE_DIR}/cmake/modules
88113
)
89114

90115
# Custom Modules
@@ -102,6 +127,7 @@ add_subdirectory(src)
102127
# p11-kit
103128
set(default_softhsm2_lib ${DEFAULT_PKCS11_LIB})
104129
configure_file(softhsm2.module.in softhsm2.module)
130+
105131
if(ENABLE_P11_KIT)
106132
install(FILES ${PROJECT_BINARY_DIR}/softhsm2.module
107133
DESTINATION ${P11KIT_PATH}

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ EXTRA_DIST = $(srcdir)/CMakeLists.txt \
2121
$(srcdir)/FIPS-NOTES.md \
2222
$(srcdir)/LICENSE \
2323
$(srcdir)/m4/*.m4 \
24-
$(srcdir)/modules/*.cmake \
25-
$(srcdir)/modules/tests/*.c \
26-
$(srcdir)/modules/tests/*.cpp \
24+
$(srcdir)/cmake/modules/*.cmake \
25+
$(srcdir)/cmake/modules/tests/*.c \
26+
$(srcdir)/cmake/modules/tests/*.cpp \
2727
$(srcdir)/OSX-NOTES.md \
2828
$(srcdir)/README.md \
2929
$(srcdir)/win32/convarch/convarch.vcxproj.in \
Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
find_package(PkgConfig)
2+
13
include(CheckCXXCompilerFlag)
24
include(CheckFunctionExists)
35
include(CheckIncludeFiles)
@@ -117,6 +119,14 @@ else(DISABLE_NON_PAGED_MEMORY)
117119
endif(NOT "${MLOCK_SIZE}" STREQUAL "unlimited")
118120
endif(DISABLE_NON_PAGED_MEMORY)
119121

122+
123+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
124+
# disable
125+
# C4996 warning for deprecated posix function name
126+
# C4456 declaration of 'identifier' hides previous local declaration
127+
set(COMPILE_OPTIONS "/MP;/W4;/wd4996;/wd4456")
128+
endif()
129+
120130
# Check if -ldl exists (equivalent of acx_dlopen.m4)
121131
check_library_exists(dl dlopen "" HAVE_DLOPEN)
122132
check_function_exists(LoadLibrary HAVE_LOADLIBRARY)
@@ -150,8 +160,8 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
150160
message(FATAL_ERROR "Failed to find Botan!")
151161
endif()
152162

153-
set(CRYPTO_INCLUDES ${BOTAN_INCLUDE_DIRS})
154-
set(CRYPTO_LIBS ${BOTAN_LIBRARIES})
163+
set(CRYPTO_INCLUDES ${BOTAN_INCLUDE_DIR})
164+
set(CRYPTO_LIBS ${BOTAN_LIBRARY})
155165
message(STATUS "Botan: Includes: ${CRYPTO_INCLUDES}")
156166
message(STATUS "Botan: Libs: ${CRYPTO_LIBS}")
157167

@@ -167,7 +177,7 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
167177

168178
# acx_botan_ecc.m4
169179
if(ENABLE_ECC)
170-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_botan_ecc.cpp)
180+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_ecc.cpp)
171181
try_run(RUN_ECC COMPILE_RESULT
172182
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
173183
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -188,7 +198,7 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
188198
# acx_botan_eddsa.m4
189199
if(ENABLE_EDDSA)
190200
# ED25519
191-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_botan_ed25519.cpp)
201+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_ed25519.cpp)
192202
try_run(RUN_ED25519 COMPILE_RESULT
193203
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
194204
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -208,7 +218,7 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
208218

209219
# acx_botan_gost.m4
210220
if(ENABLE_GOST)
211-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_botan_gost.cpp)
221+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_gost.cpp)
212222
try_run(RUN_GOST COMPILE_RESULT
213223
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
214224
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -234,7 +244,7 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
234244
set(HAVE_AES_KEY_WRAP 1)
235245

236246
# acx_botan_rfc5649.m4
237-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_botan_rfc5649.cpp)
247+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_rfc5649.cpp)
238248
try_run(RUN_AES_KEY_WRAP_PAD COMPILE_RESULT
239249
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
240250
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -249,7 +259,7 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan")
249259
endif()
250260

251261
# acx_botan_rawpss.m4
252-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_botan_rawpss.cpp)
262+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_rawpss.cpp)
253263
try_run(RUN_RAWPSS COMPILE_RESULT
254264
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
255265
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -289,7 +299,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
289299

290300
# acx_openssl_ecc.m4
291301
if(ENABLE_ECC)
292-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_ecc.c)
302+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_ecc.c)
293303
try_run(RUN_ECC COMPILE_RESULT
294304
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
295305
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -310,7 +320,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
310320
# acx_openssl_eddsa.m4
311321
if(ENABLE_EDDSA)
312322
# ED25519
313-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_ed25519.c)
323+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_ed25519.c)
314324
try_run(RUN_ED25519 COMPILE_RESULT
315325
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
316326
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -325,7 +335,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
325335
message(FATAL_ERROR ${error_msg})
326336
endif()
327337
# ED448
328-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_ed448.c)
338+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_ed448.c)
329339
try_run(RUN_ED448 COMPILE_RESULT
330340
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
331341
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -344,7 +354,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
344354

345355
# acx_openssl_gost.m4
346356
if(ENABLE_GOST)
347-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_gost.c)
357+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_gost.c)
348358
try_run(RUN_GOST COMPILE_RESULT
349359
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
350360
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -364,7 +374,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
364374

365375
# acx_openssl_fips.m4
366376
if(ENABLE_FIPS)
367-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_fips.c)
377+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_fips.c)
368378
try_run(RUN_FIPS COMPILE_RESULT
369379
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
370380
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -383,7 +393,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
383393
endif(ENABLE_FIPS)
384394

385395
# acx_openssl_rfc3349
386-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_rfc3394.c)
396+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_rfc3394.c)
387397
try_run(RUN_AES_KEY_WRAP COMPILE_RESULT
388398
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
389399
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -398,7 +408,7 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl")
398408
endif()
399409

400410
# acx_openssl_rfc5649
401-
set(testfile ${CMAKE_SOURCE_DIR}/modules/tests/test_openssl_rfc5649.c)
411+
set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_rfc5649.c)
402412
try_run(RUN_AES_KEY_WRAP_PAD COMPILE_RESULT
403413
"${CMAKE_BINARY_DIR}/prebuild_santity_tests" ${testfile}
404414
LINK_LIBRARIES ${CRYPTO_LIBS}
@@ -435,10 +445,6 @@ if(WITH_SQLITE3)
435445

436446
check_include_files(sqlite3.h HAVE_SQLITE3_H)
437447
check_library_exists(sqlite3 sqlite3_prepare_v2 "" HAVE_LIBSQLITE3)
438-
find_program(SQLITE3_COMMAND NAMES sqlite3)
439-
if(SQLITE3_COMMAND MATCHES "-NOTFOUND")
440-
message(FATAL_ERROR "SQLite3: Command was not found")
441-
endif(SQLITE3_COMMAND MATCHES "-NOTFOUND")
442448
else(WITH_SQLITE3)
443449
message(STATUS "Not including SQLite3 in build")
444450
endif(WITH_SQLITE3)
@@ -476,14 +482,15 @@ endif(ENABLE_P11_KIT)
476482

477483
if(BUILD_TESTS)
478484
# Find CppUnit (equivalent of acx_cppunit.m4)
479-
set(CppUnit_FIND_QUIETLY ON)
485+
set(CppUnit_FIND_QUIETLY OFF)
480486
include(FindCppUnit)
481487
if(NOT CPPUNIT_FOUND)
482488
message(FATAL_ERROR "Failed to find CppUnit!")
483489
endif(NOT CPPUNIT_FOUND)
484490

485491
set(CPPUNIT_INCLUDES ${CPPUNIT_INCLUDE_DIR})
486492
set(CPPUNIT_LIBS ${CPPUNIT_LIBRARY})
493+
set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES})
487494
message(STATUS "CppUnit: Includes: ${CPPUNIT_INCLUDES}")
488495
message(STATUS "CppUnit: Libs: ${CPPUNIT_LIBS}")
489496
else(BUILD_TESTS)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
#
1616
# This file is in the public domain
1717

18-
include(FindPkgConfig)
18+
find_package(Botan CONFIG)
1919

2020
if(NOT BOTAN_FOUND)
21-
pkg_check_modules(BOTAN botan-2)
21+
pkg_check_modules(botan BOTAN_FOUND)
2222
endif()
2323

24+
2425
if(NOT BOTAN_FOUND)
2526
find_path(BOTAN_INCLUDE_DIRS NAMES botan/botan.h
2627
PATH_SUFFIXES botan-2

0 commit comments

Comments
 (0)