Library for managing partitions. Common code for KDE Partition Manager and other projects. https://www.kde.org/applications/system/kdepartitionmanager/
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.

110 lines
3.6KB

  1. # Copyright (C) 2008 by Volker Lanz <vl@fidra.de>
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License as
  5. # published by the Free Software Foundation; either version 3 of
  6. # the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. project(kpmcore)
  16. cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
  17. set(CMAKE_USE_RELATIVE_PATHS OFF)
  18. set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
  19. set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "Install mkspecs files, Plugins and Imports to the Qt 5 install dir" FORCE)
  20. set(QT_MIN_VERSION "5.3.0")
  21. set(VERSION_MAJOR "1")
  22. set(VERSION_MINOR "9")
  23. set(VERSION_RELEASE "50")
  24. set(VERSION_SUFFIX "")
  25. set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}${VERSION_SUFFIX})
  26. set(SOVERSION "1")
  27. add_definitions(-D'VERSION="${VERSION}"') #"
  28. find_package(ECM 1.0.0 REQUIRED NO_MODULE)
  29. set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
  30. include(KDEInstallDirs)
  31. include(KDECMakeSettings)
  32. include(KDECompilerSettings)
  33. include(FeatureSummary)
  34. include(GenerateExportHeader)
  35. include(ECMSetupVersion)
  36. include(ECMPackageConfigHelpers)
  37. ecm_setup_version(${VERSION} VARIABLE_PREFIX KPMCORE
  38. VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpmcore_version.h"
  39. PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake"
  40. SOVERSION ${SOVERSION})
  41. find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
  42. Core
  43. Gui
  44. Widgets
  45. )
  46. # Load the frameworks we need
  47. find_package(KF5 REQUIRED
  48. I18n
  49. IconThemes
  50. KIO
  51. Service
  52. )
  53. # use sane compile flags
  54. add_definitions(
  55. -fexceptions
  56. -DQT_USE_QSTRINGBUILDER
  57. -DQT_NO_CAST_TO_ASCII
  58. -DQT_NO_CAST_FROM_ASCII
  59. -DQT_STRICT_ITERATORS
  60. -DQT_NO_URL_CAST_FROM_STRING
  61. -DQT_NO_CAST_FROM_BYTEARRAY
  62. -DQT_NO_SIGNALS_SLOTS_KEYWORDS
  63. -DQT_USE_FAST_OPERATOR_PLUS
  64. )
  65. find_package(PkgConfig REQUIRED)
  66. pkg_check_modules(BLKID REQUIRED blkid)
  67. pkg_check_modules(LIBATASMART REQUIRED libatasmart)
  68. include_directories(${Qt5Core_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE_DIRS} lib/ src/)
  69. add_subdirectory(src)
  70. # create a Config.cmake and a ConfigVersion.cmake file and install them
  71. set(INCLUDE_INSTALL_DIR "include/kpmcore/")
  72. set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KPMcore")
  73. ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KPMcoreConfig.cmake.in"
  74. "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"
  75. INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
  76. PATH_VARS INCLUDE_INSTALL_DIR
  77. )
  78. install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"
  79. "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake"
  80. DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  81. COMPONENT Devel )
  82. install(EXPORT KPMcoreTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KPMcoreTargets.cmake )
  83. ki18n_install(po)
  84. set_target_properties( kpmcore
  85. PROPERTIES VERSION ${VERSION} SOVERSION ${SOVERSION}
  86. )
  87. message(STATUS "kpmcore ${VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}")
  88. feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)