| 1 |
cmake_minimum_required(VERSION 3.10) |
| 2 |
project(TestFindSQLite3 C) |
| 3 |
include(CTest) |
| 4 |
|
| 5 |
find_package(SQLite3 REQUIRED) |
| 6 |
|
| 7 |
add_definitions(-DCMAKE_EXPECTED_SQLite3_VERSION="${SQLite3_VERSION}") |
| 8 |
|
| 9 |
add_executable(test_tgt main.c) |
| 10 |
target_link_libraries(test_tgt SQLite3::SQLite3) |
| 11 |
add_test(NAME test_tgt COMMAND test_tgt) |
| 12 |
|
| 13 |
add_executable(test_var main.c) |
| 14 |
target_include_directories(test_var PRIVATE ${SQLite3_INCLUDE_DIRS}) |
| 15 |
target_link_libraries(test_var PRIVATE ${SQLite3_LIBRARIES}) |
| 16 |
add_test(NAME test_var COMMAND test_var) |