Warning, /libraries/atcore/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: AtCore Authors
0002 # SPDX-License-Identifier: BSD-3-Clause
0003 
0004 project(AtCore)
0005 
0006 cmake_minimum_required(VERSION 3.8)
0007 set(CMAKE_CXX_STANDARD 17)
0008 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0009 
0010 find_package(ECM REQUIRED NO_MODULE)
0011 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
0012 
0013 include(CMakePackageConfigHelpers)
0014 include(ECMGenerateHeaders)
0015 include(ECMGeneratePriFile)
0016 include(ECMInstallIcons)
0017 include(ECMSetupVersion)
0018 include(FeatureSummary)
0019 include(GenerateExportHeader)
0020 include(KDECompilerSettings NO_POLICY_SCOPE)
0021 include(KDEInstallDirs)
0022 include(KDECMakeSettings)
0023 
0024 option(BUILD_GUI "Build the Test Gui")
0025 option(BUILD_DOCS "Build and Install Documents (Requires Doxygen)")
0026 option(BUILD_TESTS "Build and Run Unittests")
0027 option(DEPLOY_PLUGINS_WITH_BINARY "Deploy Plugins to bin/plugins (Use for win/mac)")
0028 
0029 include(KDEClangFormat)
0030 file(GLOB_RECURSE
0031     ALL_CLANG_FORMAT_SOURCE_FILES
0032     *.cpp
0033     *.h
0034 )
0035 
0036 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0037 
0038 set_package_properties(
0039     ECM PROPERTIES
0040     TYPE REQUIRED
0041     DESCRIPTION "Extra modules and scripts for CMake"
0042     URL "git://anongit.kde.org/extra-cmake-modules")
0043 
0044 set(PROJECT_VERSION "1.0.72")
0045 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/AtCore")
0046 
0047 # Generate version check file.
0048 ecm_setup_version(${PROJECT_VERSION}
0049     VARIABLE_PREFIX ATCORE
0050     VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/atcore_version.h"
0051     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfigVersion.cmake"
0052     SOVERSION ${PROJECT_VERSION_MAJOR}
0053 )
0054 
0055 # Get the version from git if it's a git repository
0056 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
0057   FIND_PACKAGE(Git)
0058   IF(GIT_FOUND)
0059     EXECUTE_PROCESS(
0060       COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
0061       WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
0062       OUTPUT_VARIABLE "GIT_VERSION"
0063       ERROR_QUIET
0064       OUTPUT_STRIP_TRAILING_WHITESPACE)
0065     MESSAGE( STATUS "Git Commit: ${GIT_VERSION}" )
0066     add_definitions( -DGIT_REVISION="${GIT_VERSION}")
0067   ENDIF(GIT_FOUND)
0068 ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
0069 
0070 add_definitions(-DQT_NO_CAST_FROM_ASCII
0071                 -DQT_NO_URL_CAST_FROM_STRING
0072 )
0073 
0074 set(QT_MIN_VERSION 5.15.2)
0075 
0076 find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS
0077     Core
0078     SerialPort
0079     Charts
0080     Widgets
0081 )
0082 
0083 include(ECMPoQmTools)
0084 
0085 if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/poqm")
0086     ecm_install_po_files_as_qm(poqm)
0087 endif()
0088 
0089 # Set default build type to be release
0090 if(NOT CMAKE_BUILD_TYPE)
0091     set(CMAKE_BUILD_TYPE Release)
0092 endif()
0093 
0094 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX OR CMAKE_COMPILER_IS_CLANG)
0095     # Turn warnings on by default
0096     set(CMAKE_CXX_FLAGS "-Wall -Wextra")
0097     # Set debug mode to use -g
0098     set(CMAKE_CXX_FLAGS_DEBUG "-g")
0099     # Use optimization
0100     set(CMAKE_CXX_FLAGS_RELEASE "-O3")
0101 endif()
0102 
0103 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0104 set(CMAKE_AUTOMOC ON)
0105 
0106 add_subdirectory(src)
0107 
0108 #optional Parts.
0109 if(BUILD_GUI)
0110     add_subdirectory(testclient)
0111 endif()
0112 
0113 if (BUILD_TESTS)
0114     add_subdirectory(unittests)
0115 endif()
0116 
0117 if (BUILD_DOCS)
0118     add_subdirectory(doc)
0119 endif()
0120 
0121 install(FILES
0122     "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfigVersion.cmake"
0123     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0124     COMPONENT Devel
0125 )
0126 
0127 install(FILES
0128     "${CMAKE_CURRENT_BINARY_DIR}/atcore_version.h"
0129     DESTINATION "${KDE_INSTALL_INCLUDEDIR}/AtCore/"
0130     COMPONENT Devel
0131 )
0132 
0133 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)