C++ binding for the SQLite library https://code.ireas.org/sqlitepp/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. cmake_minimum_required(VERSION 3.0)
  2. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  3. add_definitions(-std=c++11)
  4. project(sqlitepp)
  5. enable_testing()
  6. set(SOURCES src/sqlitepp/sqlitepp.cc)
  7. set(TEST_SOURCES src/sqlitepp/sqlitepp_test.cc)
  8. set(LINT_FILES include/sqlitepp/sqlitepp.h ${SOURCES} ${TEST_SOURCES})
  9. set(INCLUDES include)
  10. include(StyleCheck)
  11. include_directories(${INCLUDES})
  12. add_library(sqlitepp ${SOURCES})
  13. add_executable(sqlitepp_test ${TEST_SOURCES})
  14. find_package(Doxygen)
  15. find_package(GTest REQUIRED)
  16. find_package(Sqlite3 REQUIRED)
  17. set(DEP_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIRS})
  18. set(DEP_LIBRARIES ${SQLITE3_LIBRARIES})
  19. set(TEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS})
  20. set(TEST_LIBRARIES ${GTEST_BOTH_LIBRARIES} pthread sqlitepp)
  21. include_directories(${DEP_INCLUDE_DIRS})
  22. include_directories(${TEST_INCLUDE_DIRS})
  23. target_link_libraries(sqlitepp ${DEP_LIBRARIES})
  24. target_link_libraries(sqlitepp_test ${TEST_LIBRARIES})
  25. set(GTEST_ARGS "")
  26. gtest_add_tests(sqlitepp_test "${GTEST_ARGS}" ${TEST_SOURCES})
  27. add_style_check_target(check "${LINT_FILES}")
  28. if(DOXYGEN_FOUND)
  29. configure_file(${CMAKE_MODULE_PATH}/sqlitepp.doxyfile
  30. ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
  31. add_custom_target(doc ${DOXYGEN_EXECUTABLE}
  32. ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
  33. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  34. COMMENT "Generating API documentation with Doxygen"
  35. VERBATIM)
  36. endif(DOXYGEN_FOUND)