CMakeLists.txt 508 B

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