@@ -26,6 +26,30 @@ project(SQLiteModernCpp LANGUAGES CXX)
26
26
hunter_add_package(sqlite3)
27
27
find_package (sqlite3 CONFIG REQUIRED)
28
28
29
+ add_library (SQLiteModernCpp INTERFACE )
30
+
31
+ target_include_directories (SQLiteModernCpp INTERFACE
32
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR} /hdr>
33
+ )
34
+
35
+ include (GNUInstallDirs)
36
+
37
+ install (
38
+ TARGETS SQLiteModernCpp
39
+ EXPORT SQLiteModernCpp
40
+ )
41
+
42
+ install (
43
+ EXPORT SQLiteModernCpp
44
+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/SQLiteModernCpp"
45
+ FILE SQLiteModernCppConfig.cmake
46
+ NAMESPACE SQLiteModernCpp::
47
+ )
48
+
49
+ install (
50
+ DIRECTORY ${CMAKE_CURRENT_LIST_DIR} /hdr/
51
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
52
+ )
29
53
30
54
if (BUILD_TESTING)
31
55
hunter_add_package(Catch)
@@ -34,22 +58,22 @@ if(BUILD_TESTING)
34
58
set (TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /tests)
35
59
file (GLOB TEST_SOURCES ${TEST_SOURCE_DIR} /*.cc)
36
60
37
- IF (NOT ENABLE_SQLCIPHER_TESTS)
38
- list (REMOVE_ITEM TEST_SOURCES ${TEST_SOURCE_DIR} /sqlcipher.cc)
39
- ENDIF (NOT ENABLE_SQLCIPHER_TESTS)
61
+ IF (NOT ENABLE_SQLCIPHER_TESTS)
62
+ list (REMOVE_ITEM TEST_SOURCES ${TEST_SOURCE_DIR} /sqlcipher.cc)
63
+ ENDIF (NOT ENABLE_SQLCIPHER_TESTS)
40
64
41
- enable_testing ()
65
+ enable_testing ()
42
66
43
- add_executable (tests_runner ${TEST_SOURCES} )
44
- target_include_directories (tests_runner INTERFACE ${SQLITE3_INCLUDE_DIRS} )
67
+ add_executable (tests_runner ${TEST_SOURCES} )
68
+ target_include_directories (tests_runner INTERFACE ${SQLITE3_INCLUDE_DIRS} )
45
69
46
- if (ENABLE_SQLCIPHER_TESTS)
47
- target_link_libraries (tests_runner Catch2::Catch2 sqlite_modern_cpp sqlite3::sqlite3 -lsqlcipher)
48
- else ()
49
- target_link_libraries (tests_runner Catch2::Catch2 sqlite_modern_cpp sqlite3::sqlite3)
50
- endif ()
70
+ if (ENABLE_SQLCIPHER_TESTS)
71
+ target_link_libraries (tests_runner Catch2::Catch2 sqlite_modern_cpp sqlite3::sqlite3 -lsqlcipher)
72
+ else ()
73
+ target_link_libraries (tests_runner Catch2::Catch2 sqlite_modern_cpp sqlite3::sqlite3)
74
+ endif ()
51
75
52
- catch_discover_tests(tests_runner)
76
+ catch_discover_tests(tests_runner)
53
77
54
78
target_compile_options (tests_runner PUBLIC $<$<CXX_COMPILER_ID:MSVC >:/Zc:__cplusplus>)
55
79
endif ()
@@ -58,7 +82,7 @@ endif()
58
82
# YCM is the code-completion engine for (neo)vim https://github.com/Valloric/YouCompleteMe
59
83
IF (EXISTS "${CMAKE_BINARY_DIR} /compile_commands.json" )
60
84
EXECUTE_PROCESS (COMMAND ${CMAKE_COMMAND} -E copy_if_different
61
- ${CMAKE_BINARY_DIR} /compile_commands.json
62
- ${CMAKE_SOURCE_DIR} /compile_commands.json
63
- )
85
+ ${CMAKE_BINARY_DIR} /compile_commands.json
86
+ ${CMAKE_SOURCE_DIR} /compile_commands.json
87
+ )
64
88
ENDIF ()
0 commit comments