gio-qt/CMakeLists.txt

71 lines
1.8 KiB
CMake
Raw Normal View History

2019-07-31 11:38:18 +02:00
cmake_minimum_required(VERSION 3.12.4)
2019-07-18 13:53:39 +02:00
project(gio-qt)
2019-07-31 07:05:39 +02:00
option(BUILD_TESTS "Build tests" OFF)
2019-07-18 13:53:39 +02:00
option(BUILD_UTILS "Build utilities" ON)
2019-07-31 11:38:18 +02:00
option(BUILD_DOCS "Build documentation" ON)
2019-07-18 13:53:39 +02:00
2019-07-23 13:45:38 +02:00
# Version
if (NOT PROJECT_VERSION)
set(PROJECT_VERSION "0.0.1")
endif()
if (NOT PROJECT_VERSION_MAJOR)
set(PROJECT_VERSION_MAJOR 0)
endif()
2019-07-18 13:53:39 +02:00
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_FLAGS "-g -Wall")
set(QT_MINIMUM_VERSION "5.6.3")
2019-07-23 09:30:14 +02:00
# Install settings
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
2019-07-23 11:11:17 +02:00
include(GNUInstallDirs)
add_subdirectory(gio-qt)
2019-07-18 13:53:39 +02:00
2019-07-31 07:05:39 +02:00
if (BUILD_TESTS)
add_subdirectory(test)
endif ()
2019-07-18 13:53:39 +02:00
if (BUILD_UTILS)
add_subdirectory(qgio-tools)
2019-07-31 07:05:39 +02:00
endif ()
if (BUILD_DOCS)
find_package(Doxygen)
if (NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is required to build the documentation.")
endif ()
set (DOXYGEN_GENERATE_HTML YES)
set (DOXYGEN_GENERATE_QHP YES)
set (DOXYGEN_EXTRACT_STATIC YES)
set (DOXYGEN_OUTPUT_DIRECTORY "./docs/")
set (DOXYGEN_EXCLUDE_SYMBOLS "*Private;*Test")
set (DOXYGEN_QHG_LOCATION "qhelpgenerator")
set (DOXYGEN_QHP_NAMESPACE "org.deepin.gio-qt")
set (DOXYGEN_QCH_FILE "../gio-qt.qch")
set (DOXYGEN_QHP_VIRTUAL_FOLDER "gio-qt")
doxygen_add_docs(doxygen
${CMAKE_CURRENT_SOURCE_DIR}/gio-qt
ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gio-qt
COMMENT "Generate documentation via Doxygen"
)
2019-07-31 11:38:18 +02:00
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/docs/gio-qt.qch DESTINATION share/qt5/doc)
else ()
message (STATUS "")
message (STATUS "To build docs, please use -DBUILD_DOCS=Yes")
message (STATUS "")
endif()