@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
2
2
OPTION (ENABLE_SQLCIPHER_TESTS "enable sqlchipher test" )
3
3
4
4
# Creates the file compile_commands.json in the build directory.
5
- SET ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
5
+ SET (CMAKE_EXPORT_COMPILE_COMMANDS ON )
6
6
set (CMAKE_CXX_STANDARD 14)
7
7
8
8
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR} /cmake" )
@@ -26,12 +26,9 @@ find_package(sqlite3 CONFIG REQUIRED)
26
26
set (TEST_SOURCE_DIR ${CMAKE_SOURCE_DIR} /tests)
27
27
file (GLOB TEST_SOURCES ${TEST_SOURCE_DIR} /*.cc)
28
28
29
- message (STATUS ${ENABLE_SQLCIPHER_TESTS} )
30
29
IF (NOT ENABLE_SQLCIPHER_TESTS)
31
30
list (REMOVE_ITEM TEST_SOURCES ${TEST_SOURCE_DIR} /sqlcipher.cc)
32
31
ENDIF (NOT ENABLE_SQLCIPHER_TESTS)
33
- message (STATUS ${TEST_SOURCES} )
34
- message (STATUS ${TEST_SOURCE_DIR} /sqlcipher.cc)
35
32
36
33
enable_testing ()
37
34
@@ -40,10 +37,11 @@ target_include_directories(sqlite_modern_cpp INTERFACE hdr/)
40
37
41
38
add_executable (tests ${TEST_SOURCES} )
42
39
target_include_directories (tests INTERFACE ${SQLITE3_INCLUDE_DIRS} )
43
- target_link_libraries (tests Catch::Catch sqlite_modern_cpp sqlite3::sqlite3)
44
- IF (ENABLE_SQLCIPHER_TESTS)
45
- set_target_properties (tests PROPERTIES COMPILE_FLAGS '-lsqlcipher')
46
- ENDIF (ENABLE_SQLCIPHER_TESTS)
40
+ if (ENABLE_SQLCIPHER_TESTS)
41
+ target_link_libraries (tests Catch::Catch sqlite_modern_cpp sqlite3::sqlite3 -lsqlcipher)
42
+ else ()
43
+ target_link_libraries (tests Catch::Catch sqlite_modern_cpp sqlite3::sqlite3)
44
+ endif ()
47
45
48
46
ParseAndAddCatchTests(tests)
49
47
0 commit comments