CMakeLists.txt 985 B

123456789101112131415161718192021222324252627282930
  1. cmake_minimum_required(VERSION 3.6)
  2. set(QT_TWAIN_VERSION 0.1.0)
  3. set(QT_TWAIN_PROJECT QtTWAINProject)
  4. project(${QT_TWAIN_PROJECT} VERSION ${QT_TWAIN_VERSION} LANGUAGES CXX)
  5. include(GNUInstallDirs)
  6. set(QT_TWAIN_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
  7. set(QT_TWAIN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
  8. set(QT_TWAIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
  9. if(Qt5_POSITION_INDEPENDENT_CODE)
  10. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
  11. endif()
  12. set(CMAKE_CXX_STANDARD 14)
  13. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  14. include(CMakePackageConfigHelpers)
  15. configure_package_config_file(
  16. "${CMAKE_CURRENT_SOURCE_DIR}/ProjectConfig.cmake.in" "${QT_TWAIN_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
  17. INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake")
  18. install(FILES "${QT_TWAIN_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
  19. COMPONENT dev)
  20. export(PACKAGE ${PROJECT_NAME})
  21. add_subdirectory(src)
  22. add_subdirectory(examples)