2019-04-23 00:26:19 +02:00
|
|
|
# check whether the required project meta-data has been set before including this module
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_PROJECT_NAME)
|
2017-02-11 02:30:46 +01:00
|
|
|
message(FATAL_ERROR "No project name (META_PROJECT_NAME) specified.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_APP_NAME)
|
2017-02-11 02:30:46 +01:00
|
|
|
message(FATAL_ERROR "No project name (META_APP_NAME) specified.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_APP_AUTHOR)
|
2017-02-11 02:30:46 +01:00
|
|
|
message(FATAL_ERROR "No project name (META_APP_AUTHOR) specified.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_APP_DESCRIPTION)
|
2017-02-11 02:30:46 +01:00
|
|
|
message(FATAL_ERROR "No project name (META_APP_DESCRIPTION) specified.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-04-16 00:50:16 +02:00
|
|
|
|
|
|
|
# set project name (displayed in Qt Creator)
|
2019-07-20 18:04:10 +02:00
|
|
|
# note: The project name is at least shown in Qt Creator this way but unfortunately setting project() from
|
|
|
|
# an included file is not sufficient (see https://cmake.org/cmake/help/latest/command/project.html#usage).
|
2019-04-23 00:26:19 +02:00
|
|
|
message(STATUS "Configuring project ${META_PROJECT_NAME}")
|
2016-04-16 00:50:16 +02:00
|
|
|
project(${META_PROJECT_NAME})
|
|
|
|
|
2016-09-29 20:28:02 +02:00
|
|
|
# set META_PROJECT_VARNAME and META_PROJECT_VARNAME_UPPER if not specified explicitely
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_PROJECT_VARNAME)
|
2016-11-04 14:02:23 +01:00
|
|
|
set(META_PROJECT_VARNAME "${META_PROJECT_NAME}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_PROJECT_VARNAME_UPPER)
|
2016-09-29 20:28:02 +02:00
|
|
|
string(TOUPPER ${META_PROJECT_VARNAME} META_PROJECT_VARNAME_UPPER)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_PROJECT_VARNAME_LOWER)
|
|
|
|
string(REGEX
|
|
|
|
REPLACE "_+"
|
|
|
|
""
|
|
|
|
META_PROJECT_VARNAME_LOWER
|
|
|
|
"${META_PROJECT_VARNAME}")
|
2017-02-11 02:30:46 +01:00
|
|
|
string(TOLOWER "${META_PROJECT_VARNAME_LOWER}" META_PROJECT_VARNAME_LOWER)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-09-29 20:28:02 +02:00
|
|
|
|
2019-05-04 20:57:56 +02:00
|
|
|
# allow setting a configuration name to allow installing multiple differently configured versions within the same prefix
|
|
|
|
# (intended to be used for installing Qt 5 and Qt 6 version or shared and static version within the same prefix)
|
2019-04-23 00:26:19 +02:00
|
|
|
set(${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_NAME "" CACHE STRING "sets the configuration name for ${META_PROJECT_NAME}")
|
|
|
|
set(CONFIGURATION_NAME "" CACHE STRING "sets the configuration name for all projects within the current build")
|
|
|
|
if (${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_NAME STREQUAL "none")
|
|
|
|
set(META_CONFIG_NAME "")
|
|
|
|
elseif (${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_NAME)
|
|
|
|
set(META_CONFIG_NAME "${${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_NAME}")
|
2019-05-04 20:57:56 +02:00
|
|
|
else ()
|
2019-04-23 00:26:19 +02:00
|
|
|
set(META_CONFIG_NAME "${CONFIGURATION_NAME}")
|
|
|
|
endif ()
|
|
|
|
if (META_CONFIG_NAME)
|
|
|
|
set(META_CONFIG_PREFIX "${META_CONFIG_NAME}-")
|
|
|
|
set(META_CONFIG_SUFFIX "-${META_CONFIG_NAME}")
|
|
|
|
endif ()
|
|
|
|
|
2019-05-04 20:57:56 +02:00
|
|
|
# allow setting a library/application target suffix - A different configuration name might not require a different target
|
|
|
|
# name since it might differ anyways (e.g. library extensions for static and shared configuration). Hence there's not simply
|
|
|
|
# the configuration name used to distinguish targets as well.
|
2019-06-01 12:14:30 +02:00
|
|
|
set(${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX
|
|
|
|
""
|
2019-05-04 20:57:56 +02:00
|
|
|
CACHE STRING "sets a target suffix for ${META_PROJECT_NAME}")
|
2019-04-23 00:26:19 +02:00
|
|
|
set(CONFIGURATION_TARGET_SUFFIX "" CACHE STRING "sets the target suffix for all projects within the current build")
|
|
|
|
if (${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX STREQUAL "none")
|
|
|
|
set(TARGET_SUFFIX "")
|
|
|
|
elseif (${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX)
|
|
|
|
set(TARGET_SUFFIX "-${${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX}")
|
|
|
|
elseif (CONFIGURATION_TARGET_SUFFIX)
|
|
|
|
set(TARGET_SUFFIX "-${CONFIGURATION_TARGET_SUFFIX}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# define a few variables
|
|
|
|
set(META_TARGET_NAME "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}")
|
2019-05-04 20:57:56 +02:00
|
|
|
set(META_DATA_DIR "share/${META_PROJECT_NAME}${META_CONFIG_SUFFIX}")
|
2019-04-23 00:26:19 +02:00
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" META_CURRENT_CONFIGURATION)
|
|
|
|
|
2016-11-04 14:02:23 +01:00
|
|
|
# set META_GENERIC_NAME to META_APP_NAME if not specified explicitely
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_GENERIC_NAME)
|
2016-11-04 14:02:23 +01:00
|
|
|
set(META_GENERIC_NAME "${META_APP_NAME}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-11-04 14:02:23 +01:00
|
|
|
|
2017-02-05 19:19:15 +01:00
|
|
|
# set default CXX_STANDARD for all library, application and test targets
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_CXX_STANDARD)
|
2019-05-11 18:42:38 +02:00
|
|
|
set(META_CXX_STANDARD 17)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-02-04 17:44:46 +01:00
|
|
|
|
2017-02-11 02:30:46 +01:00
|
|
|
# set version to 0.0.0 if not specified explicitely
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_VERSION_MAJOR)
|
2017-02-11 02:30:46 +01:00
|
|
|
set(META_VERSION_MAJOR 0)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_VERSION_MINOR)
|
2017-02-11 02:30:46 +01:00
|
|
|
set(META_VERSION_MINOR 0)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_VERSION_PATCH)
|
2017-02-11 02:30:46 +01:00
|
|
|
set(META_VERSION_PATCH 0)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-02-11 02:30:46 +01:00
|
|
|
|
2019-04-22 22:19:08 +02:00
|
|
|
# set META_ID to target name if not specified
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_ID)
|
2019-04-22 22:19:08 +02:00
|
|
|
set(META_ID "${META_TARGET_NAME}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-02-18 20:18:00 +01:00
|
|
|
|
|
|
|
# set bugtracker URL
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_APP_BUGTRACKER_URL)
|
|
|
|
if (META_APP_URL MATCHES "https://(github.com|gitlab.com|.*/(gogs|gitea)|(gogs|gitea).*)/.*")
|
2018-02-18 20:18:00 +01:00
|
|
|
set(META_APP_BUGTRACKER_URL "${META_APP_URL}/issues")
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2018-02-18 20:18:00 +01:00
|
|
|
set(META_APP_BUGTRACKER_URL "${META_APP_URL}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2018-02-18 20:18:00 +01:00
|
|
|
|
2018-02-21 21:58:27 +01:00
|
|
|
# determine license automatically from LICENSE file
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_PROJECT_LICENSE)
|
|
|
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
2018-02-21 21:58:27 +01:00
|
|
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" META_PROJECT_LICENSE_FILE)
|
2019-02-06 17:30:52 +01:00
|
|
|
elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE")
|
2018-02-21 21:58:27 +01:00
|
|
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE" META_PROJECT_LICENSE_FILE)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (META_PROJECT_LICENSE_FILE MATCHES "GNU GENERAL PUBLIC LICENSE.*Version ([1-9\\.]*)")
|
2018-02-21 21:58:27 +01:00
|
|
|
set(META_PROJECT_LICENSE "GPL-${CMAKE_MATCH_1}")
|
2019-02-06 17:30:52 +01:00
|
|
|
elseif (META_PROJECT_LICENSE_FILE MATCHES "GNU LESSER GENERAL PUBLIC LICENSE.*Version ([1-9\\.]*)")
|
2018-02-21 21:58:27 +01:00
|
|
|
set(META_PROJECT_LICENSE "LGPL-${CMAKE_MATCH_1}")
|
2019-02-06 17:30:52 +01:00
|
|
|
elseif (META_PROJECT_LICENSE_FILE MATCHES "MIT License")
|
2018-02-21 21:58:27 +01:00
|
|
|
set(META_PROJECT_LICENSE "MIT")
|
2019-02-06 17:30:52 +01:00
|
|
|
elseif (META_PROJECT_LICENSE_FILE MATCHES "Mozilla Public License Version ([1-9\\.]*)")
|
2018-02-21 21:58:27 +01:00
|
|
|
set(META_PROJECT_LICENSE "MPL-${CMAKE_MATCH_1}")
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
|
|
|
message(
|
|
|
|
WARNING
|
|
|
|
"Unable to detect license of ${META_PROJECT_NAME}. Set META_PROJECT_LICENSE manually to silence this warning."
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2018-02-21 21:58:27 +01:00
|
|
|
|
2019-02-06 17:30:52 +01:00
|
|
|
# provide variables for other projects built as part of the same subdirs project to access files from this project
|
2016-04-16 18:32:22 +02:00
|
|
|
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (HAS_PARENT)
|
2016-09-29 20:28:02 +02:00
|
|
|
set(${META_PROJECT_VARNAME_UPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
|
|
|
|
set(${META_PROJECT_VARNAME_UPPER}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
2016-04-16 18:32:22 +02:00
|
|
|
set(${META_PROJECT_NAME}_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
2018-09-16 00:25:04 +02:00
|
|
|
set(RUNTIME_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}" ${RUNTIME_LIBRARY_PATH} PARENT_SCOPE)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-04-16 00:50:16 +02:00
|
|
|
|
2017-04-15 01:39:04 +02:00
|
|
|
# determine version
|
|
|
|
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
2019-02-06 17:30:52 +01:00
|
|
|
option(
|
|
|
|
APPEND_GIT_REVISION
|
|
|
|
"whether the build script should attempt to append the git revision and latest commit to the version displayed via --help"
|
|
|
|
ON)
|
|
|
|
if (APPEND_GIT_REVISION)
|
2018-12-08 19:04:01 +01:00
|
|
|
find_program(GIT_BIN git)
|
2019-02-06 17:30:52 +01:00
|
|
|
execute_process(COMMAND ${GIT_BIN} rev-list --count HEAD
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
OUTPUT_VARIABLE META_GIT_REV_COUNT)
|
|
|
|
execute_process(COMMAND ${GIT_BIN} rev-parse --short HEAD
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
OUTPUT_VARIABLE META_GIT_LAST_COMMIT_ID)
|
|
|
|
string(REPLACE "\n"
|
|
|
|
""
|
|
|
|
META_GIT_REV_COUNT
|
|
|
|
"${META_GIT_REV_COUNT}")
|
|
|
|
string(REPLACE "\n"
|
|
|
|
""
|
|
|
|
META_GIT_LAST_COMMIT_ID
|
|
|
|
"${META_GIT_LAST_COMMIT_ID}")
|
|
|
|
if (META_GIT_REV_COUNT AND META_GIT_LAST_COMMIT_ID)
|
2017-04-15 01:39:04 +02:00
|
|
|
set(META_APP_VERSION ${META_APP_VERSION}-${META_GIT_REV_COUNT}.${META_GIT_LAST_COMMIT_ID})
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-04-15 01:39:04 +02:00
|
|
|
|
2016-07-02 02:04:32 +02:00
|
|
|
# set TARGET_EXECUTABLE which is used to refer to the target executable at its installation location
|
2019-04-22 22:19:08 +02:00
|
|
|
set(TARGET_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bin/${META_TARGET_NAME}")
|
2016-07-02 02:04:32 +02:00
|
|
|
|
2018-06-03 21:49:01 +02:00
|
|
|
# create header for feature detection
|
2018-06-03 22:15:20 +02:00
|
|
|
if (META_FEATURES_FOR_COMPILER_DETECTION_HEADER)
|
2018-06-03 21:49:01 +02:00
|
|
|
include(WriteCompilerDetectionHeader)
|
2019-02-06 17:30:52 +01:00
|
|
|
write_compiler_detection_header(FILE
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/resources/features.h"
|
|
|
|
PREFIX
|
|
|
|
"${META_PROJECT_VARNAME_UPPER}"
|
|
|
|
COMPILERS
|
|
|
|
GNU
|
|
|
|
Clang
|
2019-07-13 04:22:21 +02:00
|
|
|
AppleClang
|
2019-02-06 17:30:52 +01:00
|
|
|
FEATURES
|
|
|
|
${META_FEATURES_FOR_COMPILER_DETECTION_HEADER})
|
|
|
|
endif ()
|
2018-06-03 21:49:01 +02:00
|
|
|
|
2016-04-16 00:50:16 +02:00
|
|
|
# disable new ABI (can't catch ios_base::failure with new ABI)
|
2016-07-10 00:16:24 +02:00
|
|
|
option(FORCE_OLD_ABI "specifies whether usage of old ABI should be forced" OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (FORCE_OLD_ABI)
|
2016-11-10 23:24:09 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS _GLIBCXX_USE_CXX11_ABI=0)
|
2016-06-14 22:53:19 +02:00
|
|
|
message(STATUS "Forcing usage of old CXX11 ABI.")
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2016-07-16 23:04:22 +02:00
|
|
|
message(STATUS "Using default CXX11 ABI (not forcing old CX11 ABI).")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-04-16 00:50:16 +02:00
|
|
|
|
|
|
|
# enable debug-only code when doing a debug build
|
2019-02-06 17:30:52 +01:00
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2019-06-12 20:34:25 +02:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS CPP_UTILITIES_DEBUG_BUILD)
|
2016-04-16 00:50:16 +02:00
|
|
|
message(STATUS "Debug build enabled.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-07-03 22:13:04 +02:00
|
|
|
|
|
|
|
# enable logging when option is set
|
2016-07-10 00:16:24 +02:00
|
|
|
option(LOGGING_ENABLED "specifies whether logging is enabled" OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (LOGGING_ENABLED)
|
2016-11-10 23:24:09 +01:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS LOGGING_ENABLED)
|
2016-07-10 00:16:24 +02:00
|
|
|
message(STATUS "Logging is enabled.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2016-07-22 01:35:32 +02:00
|
|
|
|
2018-07-27 16:19:16 +02:00
|
|
|
# determine whether the project is a header-only library
|
2019-02-06 17:30:52 +01:00
|
|
|
if (SRC_FILES OR GUI_SRC_FILES OR WIDGETS_SRC_FILES OR WIDGETS_UI_FILES OR QML_SRC_FILES OR RES_FILES)
|
2018-07-27 16:19:16 +02:00
|
|
|
set(META_HEADER_ONLY_LIB NO)
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2018-07-27 16:19:16 +02:00
|
|
|
set(META_HEADER_ONLY_LIB YES)
|
2019-02-06 17:30:52 +01:00
|
|
|
if ("${META_PROJECT_TYPE}" STREQUAL "application")
|
2018-07-27 16:19:16 +02:00
|
|
|
message(FATAL_ERROR "Project ${META_PROJECT_NAME} is supposed to be an application but has only header files.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
message(STATUS "Project ${META_PROJECT_NAME} is header-only library.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
2019-04-03 22:06:27 +02:00
|
|
|
# ensure 3rdParty has been included to configure BUILD_SHARED_LIBS and STATIC_LINKAGE/STATIC_LIBRARY_LINKAGE
|
|
|
|
include(3rdParty)
|
|
|
|
|
2016-08-14 16:49:40 +02:00
|
|
|
# options for enabling/disabling Qt GUI (if available)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (WIDGETS_HEADER_FILES OR WIDGETS_SRC_FILES OR WIDGETS_UI_FILES OR META_HAS_WIDGETS_GUI)
|
|
|
|
if (META_GUI_OPTIONAL)
|
2016-08-14 16:49:40 +02:00
|
|
|
option(WIDGETS_GUI "enables/disables building the Qt Widgets GUI: yes (default) or no" ON)
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2016-08-14 16:49:40 +02:00
|
|
|
set(WIDGETS_GUI ON)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
else ()
|
2016-08-14 16:49:40 +02:00
|
|
|
set(WIDGETS_GUI OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (QML_HEADER_FILES OR QML_SRC_FILES OR META_HAS_QUICK_GUI)
|
|
|
|
if (META_GUI_OPTIONAL)
|
2016-08-14 16:49:40 +02:00
|
|
|
option(QUICK_GUI "enables/disables building the Qt Quick GUI: yes (default) or no" ON)
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2016-08-14 16:49:40 +02:00
|
|
|
set(QUICK_GUI ON)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
else ()
|
2016-08-14 16:49:40 +02:00
|
|
|
set(QUICK_GUI OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-02-11 02:30:46 +01:00
|
|
|
|
2017-04-03 23:27:39 +02:00
|
|
|
# find coding style (use style from c++utilities if none included in own project dir)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_TIDY)
|
2017-05-01 03:03:20 +02:00
|
|
|
set(CLANG_FORMAT_RULES "${CMAKE_CURRENT_SOURCE_DIR}/coding-style.clang-format")
|
2019-02-06 17:30:52 +01:00
|
|
|
if (CPP_UTILITIES_SOURCE_DIR AND NOT EXISTS "${CLANG_FORMAT_RULES}")
|
2017-05-01 03:03:20 +02:00
|
|
|
set(CLANG_FORMAT_RULES "${CPP_UTILITIES_SOURCE_DIR}/coding-style.clang-format")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT EXISTS "${CLANG_FORMAT_RULES}")
|
2017-05-01 03:03:20 +02:00
|
|
|
set(CLANG_FORMAT_RULES "${CPP_UTILITIES_CONFIG_DIRS}/codingstyle.clang-format")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-04-03 23:27:39 +02:00
|
|
|
|
2017-04-04 20:13:13 +02:00
|
|
|
# enable testing
|
|
|
|
enable_testing()
|
|
|
|
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (HAS_PARENT)
|
2017-04-04 20:13:13 +02:00
|
|
|
message(STATUS "For the check target to work, it is required to call enable_testing() on the source directory root.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-04-04 20:13:13 +02:00
|
|
|
|
2019-02-06 17:30:52 +01:00
|
|
|
# make finding testfiles in out-of-source-tree build more convenient by adding a reference to the source directory (not only
|
|
|
|
# useful if there's a test target; this is for instance also used in mocked configuration of syncthingtray) -> add a file
|
|
|
|
# called "srcdirref" to the build directory; this file contains the path of the sources so tests can easily find test files
|
|
|
|
# contained in the source directory
|
2018-05-01 23:59:28 +02:00
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/srcdirref" "${CMAKE_CURRENT_SOURCE_DIR}")
|
2019-02-06 17:30:52 +01:00
|
|
|
# -> ensure the directory "testfiles" exists in the build directory; tests of my projects use it by default to create working
|
|
|
|
# copies of testfiles
|
2018-05-01 23:59:28 +02:00
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/testfiles")
|
|
|
|
|
2018-07-27 16:19:16 +02:00
|
|
|
# determine source files which might be passed to clang-format or clang-tidy
|
|
|
|
set(FORMATABLE_FILES
|
2019-02-06 17:30:52 +01:00
|
|
|
${HEADER_FILES}
|
|
|
|
${SRC_FILES}
|
|
|
|
${TEST_HEADER_FILES}
|
|
|
|
${TEST_SRC_FILES}
|
|
|
|
${GUI_HEADER_FILES}
|
|
|
|
${GUI_SRC_FILES}
|
|
|
|
${WIDGETS_HEADER_FILES}
|
|
|
|
${WIDGETS_SRC_FILES}
|
|
|
|
${QML_HEADER_FILES}
|
2019-07-13 13:56:15 +02:00
|
|
|
${QML_SRC_FILES}
|
|
|
|
${EXCLUDED_FILES})
|
2018-07-27 16:19:16 +02:00
|
|
|
# only format C/C++ files (and not eg. QML files)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (FORMATABLE_FILES)
|
2019-06-01 12:14:30 +02:00
|
|
|
list(FILTER
|
|
|
|
FORMATABLE_FILES
|
|
|
|
INCLUDE
|
|
|
|
REGEX
|
|
|
|
".*\\.(c|cpp|h|hpp)")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
2019-02-05 22:50:05 +01:00
|
|
|
# determine source files which might be passed to cmake-format
|
2019-02-06 17:30:52 +01:00
|
|
|
set(FORMATABLE_FILES_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_MODULE_FILES})
|
2019-02-05 22:50:05 +01:00
|
|
|
|
2018-07-27 16:19:16 +02:00
|
|
|
# add command for symlinking clang-{format,tidy} rules so the tools can find it
|
2019-02-06 17:30:52 +01:00
|
|
|
if (EXISTS "${CLANG_FORMAT_RULES}")
|
|
|
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/.clang-format"
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CLANG_FORMAT_RULES}"
|
2019-06-01 12:14:30 +02:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/.clang-format"
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMENT "Linking coding style from ${CLANG_FORMAT_RULES}")
|
|
|
|
else ()
|
2018-09-16 00:25:04 +02:00
|
|
|
message(WARNING "Format rules for clang-format not found.")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
2019-02-05 22:50:05 +01:00
|
|
|
# allow user to configure creation of tidy targets unless the project disables this via META_NO_TIDY
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_TIDY)
|
2017-06-20 23:38:45 +02:00
|
|
|
option(CLANG_FORMAT_ENABLED "enables creation of tidy target using clang-format" OFF)
|
2019-02-05 22:50:05 +01:00
|
|
|
option(CMAKE_FORMAT_ENABLED "enables creation of tidy target using cmake-format" OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
2019-02-05 22:50:05 +01:00
|
|
|
# add target for tidying with clang-format
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_TIDY AND CLANG_FORMAT_ENABLED AND FORMATABLE_FILES AND EXISTS "${CLANG_FORMAT_RULES}")
|
2019-02-05 22:50:05 +01:00
|
|
|
find_program(CLANG_FORMAT_BIN clang-format)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT CLANG_FORMAT_BIN)
|
2019-02-05 22:50:05 +01:00
|
|
|
message(FATAL_ERROR "Unable to add tidy target; clang-format not found")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-04-22 22:19:08 +02:00
|
|
|
add_custom_target("${META_TARGET_NAME}_tidy"
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMAND "${CLANG_FORMAT_BIN}" -style=file -i ${FORMATABLE_FILES}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
COMMENT "Tidying ${META_PROJECT_NAME} sources using clang-format"
|
|
|
|
DEPENDS "${FORMATABLE_FILES};${CMAKE_CURRENT_SOURCE_DIR}/.clang-format")
|
|
|
|
if (NOT TARGET tidy)
|
2019-02-05 22:50:05 +01:00
|
|
|
add_custom_target(tidy)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-04-22 22:19:08 +02:00
|
|
|
add_dependencies(tidy "${META_TARGET_NAME}_tidy")
|
2019-02-05 22:50:05 +01:00
|
|
|
|
|
|
|
# also add a test to verify whether sources are tidy
|
2019-04-22 22:19:08 +02:00
|
|
|
add_test(NAME "${META_TARGET_NAME}_tidy_test"
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMAND "${CLANG_FORMAT_BIN}" -output-replacements-xml -style=file ${FORMATABLE_FILES}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
2019-02-05 22:50:05 +01:00
|
|
|
list(APPEND CHECK_TARGET_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.clang-format")
|
2019-04-22 22:19:08 +02:00
|
|
|
set_tests_properties("${META_TARGET_NAME}_tidy_test"
|
2019-02-06 17:30:52 +01:00
|
|
|
PROPERTIES FAIL_REGULAR_EXPRESSION
|
|
|
|
"<replacement.*>.*</replacement>"
|
|
|
|
REQUIRED_FILES
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/.clang-format")
|
|
|
|
endif ()
|
2019-02-05 22:50:05 +01:00
|
|
|
|
|
|
|
# add target for tidying with cmake-format
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_TIDY AND CMAKE_FORMAT_ENABLED AND FORMATABLE_FILES_CMAKE)
|
2019-02-05 22:50:05 +01:00
|
|
|
find_program(CMAKE_FORMAT_BIN cmake-format)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT CMAKE_FORMAT_BIN)
|
2019-02-05 22:50:05 +01:00
|
|
|
message(FATAL_ERROR "Unable to add tidy target; cmake-format not found")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-02-05 22:50:05 +01:00
|
|
|
if (NOT META_CMAKE_FORMAT_OPTIONS)
|
2019-06-10 22:43:42 +02:00
|
|
|
set(META_CMAKE_FORMAT_OPTIONS
|
|
|
|
--tab-size=4
|
|
|
|
--separate-ctrl-name-with-space=True
|
|
|
|
--line-width=125
|
|
|
|
--autosort=False)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-04-22 22:19:08 +02:00
|
|
|
add_custom_target("${META_TARGET_NAME}_cmake_tidy"
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMAND "${CMAKE_FORMAT_BIN}" --in-place ${META_CMAKE_FORMAT_OPTIONS} ${FORMATABLE_FILES_CMAKE}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
COMMENT "Tidying ${META_PROJECT_NAME} sources using cmake-format"
|
|
|
|
DEPENDS "${FORMATABLE_FILES_CMAKE}")
|
|
|
|
if (NOT TARGET tidy)
|
2019-02-05 22:50:05 +01:00
|
|
|
add_custom_target(tidy)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-04-22 22:19:08 +02:00
|
|
|
add_dependencies(tidy "${META_TARGET_NAME}_cmake_tidy")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# add target for static code analysis using clang-tidy
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_STATIC_ANALYSIS AND FORMATABLE_FILES)
|
2018-07-27 16:19:16 +02:00
|
|
|
option(CLANG_TIDY_ENABLED "enables creation of static-check target using clang-tidy" OFF)
|
2019-06-01 12:14:30 +02:00
|
|
|
set(CLANG_TIDY_CHECKS
|
|
|
|
""
|
2019-02-06 17:30:52 +01:00
|
|
|
CACHE STRING
|
|
|
|
"-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,performance-*,portability-*,readability-*,android-*")
|
|
|
|
if (CLANG_TIDY_ENABLED)
|
2018-07-27 16:19:16 +02:00
|
|
|
find_program(CLANG_TIDY_BIN clang-tidy)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT CLANG_TIDY_BIN)
|
2018-07-27 16:19:16 +02:00
|
|
|
message(FATAL_ERROR "Unable to add tidy target; clang-tidy not found")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
set(CLANG_TIDY_DEPENDS ${FORMATABLE_FILES})
|
|
|
|
|
|
|
|
# compose options for clang-tidy
|
2019-02-06 17:30:52 +01:00
|
|
|
set(CLANG_TIDY_OPTIONS -checks="${CLANG_TIDY_CHECKS}" -header-filter="^${META_PROJECT_NAME}/")
|
|
|
|
if (EXISTS "${CLANG_FORMAT_RULES}")
|
2018-07-27 16:19:16 +02:00
|
|
|
list(APPEND CLANG_TIDY_OPTIONS "-format-style=file")
|
|
|
|
list(APPEND CLANG_TIDY_DPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.clang-format")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# compose CXX flags for clang-tidy
|
|
|
|
set(CLANG_TIDY_CXX_FLAGS "")
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_HEADER_ONLY_LIB)
|
2018-07-27 16:19:16 +02:00
|
|
|
# deduce flags from target
|
2019-04-22 22:19:08 +02:00
|
|
|
set(TARGET_NAME ${META_TARGET_NAME})
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
|
2018-07-27 16:19:16 +02:00
|
|
|
set(TARGET_NAME "${TARGET_NAME}_static")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
# set c++ standard
|
|
|
|
list(APPEND CLANG_TIDY_CXX_FLAGS "-std=c++$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>")
|
|
|
|
# add compile flags
|
|
|
|
set(PROP "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_FLAGS>")
|
|
|
|
list(APPEND CLANG_TIDY_CXX_FLAGS "$<$<BOOL:${PROP}>:$<JOIN:${PROP},$<SEMICOLON>>>")
|
|
|
|
# add compile definitions
|
|
|
|
set(PROP "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_DEFINITIONS>")
|
|
|
|
list(APPEND CLANG_TIDY_CXX_FLAGS "$<$<BOOL:${PROP}>:-D$<JOIN:${PROP},$<SEMICOLON>-D>>")
|
|
|
|
# add include directories
|
|
|
|
set(PROP "$<TARGET_PROPERTY:${TARGET_NAME},INCLUDE_DIRECTORIES>")
|
|
|
|
list(APPEND CLANG_TIDY_CXX_FLAGS "$<$<BOOL:${PROP}>:-I$<JOIN:${PROP},$<SEMICOLON>-I>>")
|
2019-02-06 17:30:52 +01:00
|
|
|
else ()
|
2018-07-27 16:19:16 +02:00
|
|
|
# set at least c++ standard for header-only libs
|
|
|
|
list(APPEND CLANG_TIDY_CXX_FLAGS "-std=c++${META_CXX_STANDARD}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# add a custom command for each source file
|
|
|
|
set(CLANG_TIDY_SYMBOLIC_OUTPUT_FILES "")
|
2019-02-06 17:30:52 +01:00
|
|
|
foreach (FILE ${FORMATABLE_FILES})
|
2018-07-27 16:19:16 +02:00
|
|
|
# skip header files
|
2019-02-06 17:30:52 +01:00
|
|
|
if (${FILE} MATCHES ".*\.h")
|
2018-07-27 16:19:16 +02:00
|
|
|
continue()
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# use symbolic output file since there's no actual output file (we're just interested in the log)
|
|
|
|
set(SYMBOLIC_OUTPUT_FILE "${FILE}.clang-tidy-output")
|
|
|
|
list(APPEND CLANG_TIDY_SYMBOLIC_OUTPUT_FILES "${SYMBOLIC_OUTPUT_FILE}")
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT "${SYMBOLIC_OUTPUT_FILE}"
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMAND "${CLANG_TIDY_BIN}" ${FILE} -- ${CLANG_TIDY_CXX_FLAGS}
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
COMMENT "Linting ${FILE} using clang-tidy"
|
|
|
|
DEPENDS "${FILE}" COMMAND_EXPAND_LISTS
|
|
|
|
VERBATIM)
|
|
|
|
endforeach ()
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# mark all symbolic output files actually as symbolic
|
2019-06-01 12:14:30 +02:00
|
|
|
set_source_files_properties(${CLANG_TIDY_SYMBOLIC_OUTPUT_FILES}
|
|
|
|
PROPERTIES
|
|
|
|
SYMBOLIC
|
|
|
|
YES)
|
2018-07-27 16:19:16 +02:00
|
|
|
|
|
|
|
# add targets
|
2019-04-22 22:19:08 +02:00
|
|
|
add_custom_target("${META_TARGET_NAME}_static_check"
|
2019-02-06 17:30:52 +01:00
|
|
|
DEPENDS ${CLANG_TIDY_SYMBOLIC_OUTPUT_FILES}
|
2019-04-22 22:19:08 +02:00
|
|
|
COMMENT "Linting ${META_TARGET_NAME} sources using clang-tidy")
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT TARGET static-check)
|
2018-07-27 16:19:16 +02:00
|
|
|
add_custom_target(static-check)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2019-04-22 22:19:08 +02:00
|
|
|
add_dependencies(static-check "${META_TARGET_NAME}_static_check")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-04-03 23:27:39 +02:00
|
|
|
|
2017-06-01 18:24:14 +02:00
|
|
|
# add autotools-style check target
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT TARGET check)
|
2017-06-01 18:24:14 +02:00
|
|
|
set(CMAKE_CTEST_COMMAND ${CMAKE_CTEST_COMMAND} -V)
|
|
|
|
add_custom_target(check
|
2019-02-06 17:30:52 +01:00
|
|
|
COMMAND ${CMAKE_CTEST_COMMAND}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
DEPENDS "${CHECK_TARGET_DEPENDS}")
|
|
|
|
endif ()
|
2017-06-01 18:24:14 +02:00
|
|
|
|
2017-06-18 16:17:44 +02:00
|
|
|
# enable source code based coverage analysis using clang
|
2017-06-20 23:38:45 +02:00
|
|
|
option(CLANG_SOURCE_BASED_COVERAGE_ENABLED "enables creation of coverage targets for source-based coverage with clang" OFF)
|
2019-02-06 17:30:52 +01:00
|
|
|
if (CLANG_SOURCE_BASED_COVERAGE_ENABLED)
|
2019-06-01 12:14:30 +02:00
|
|
|
if (NOT CMAKE_HOST_UNIX OR NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2017-06-20 23:38:45 +02:00
|
|
|
message(FATAL_ERROR "Source-based coverage only available under UNIX with Clang")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
|
|
|
if (NOT META_PROJECT_TYPE STREQUAL "application" AND DISABLE_SHARED_LIBS)
|
2017-07-28 17:34:28 +02:00
|
|
|
message(FATAL_ERROR "Source-based coverage not available when only building static libs")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-07-28 17:34:28 +02:00
|
|
|
set(CLANG_SOURCE_BASED_COVERAGE_AVAILABLE YES)
|
|
|
|
set(CLANG_SOURCE_BASED_COVERAGE_FLAGS -fprofile-instr-generate -fcoverage-mapping)
|
2019-04-23 00:26:19 +02:00
|
|
|
list(APPEND META_PRIVATE_COMPILE_OPTIONS ${CLANG_SOURCE_BASED_COVERAGE_FLAGS})
|
|
|
|
list(APPEND META_ADDITIONAL_LINK_FLAGS ${CLANG_SOURCE_BASED_COVERAGE_FLAGS})
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-06-18 16:17:44 +02:00
|
|
|
|
2017-07-20 01:43:10 +02:00
|
|
|
# configure creation of install targets
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_INSTALL_TARGETS)
|
|
|
|
# install targets have not been disabled on project level check whether install targets are disabled by the user this
|
|
|
|
# might be useful since install targets seem to cause problems under MacOS
|
2017-07-20 01:43:10 +02:00
|
|
|
option(ENABLE_INSTALL_TARGETS "enables creation of install targets" ON)
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2017-07-20 01:43:10 +02:00
|
|
|
|
2017-07-11 19:34:38 +02:00
|
|
|
# add install target for extra files
|
2019-02-06 17:30:52 +01:00
|
|
|
if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
|
|
|
|
foreach (EXTRA_FILE ${EXTRA_FILES})
|
2017-07-20 01:43:10 +02:00
|
|
|
get_filename_component(EXTRA_DIR ${EXTRA_FILE} DIRECTORY)
|
2019-04-23 00:26:19 +02:00
|
|
|
install(FILES ${EXTRA_FILE} DESTINATION "${META_DATA_DIR}/${EXTRA_DIR}" COMPONENT extra-files)
|
2019-02-06 17:30:52 +01:00
|
|
|
endforeach ()
|
|
|
|
if (NOT TARGET install-extra-files)
|
2017-07-20 01:43:10 +02:00
|
|
|
add_custom_target(install-extra-files
|
2019-06-01 12:14:30 +02:00
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-DCMAKE_INSTALL_COMPONENT=extra-files -P
|
2019-02-06 17:30:52 +01:00
|
|
|
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-07-11 19:34:38 +02:00
|
|
|
|
2019-04-23 00:26:19 +02:00
|
|
|
# determine library directory suffix - Applications might be built as libraries under some platforms (eg. Android). Hence
|
2019-02-06 17:30:52 +01:00
|
|
|
# this is part of BasicConfig and not LibraryConfig.
|
2018-09-16 00:25:04 +02:00
|
|
|
set(LIB_SUFFIX "" CACHE STRING "specifies the general suffix for the library directory")
|
|
|
|
set(SELECTED_LIB_SUFFIX "${LIB_SUFFIX}")
|
|
|
|
set(LIB_SUFFIX_32 "" CACHE STRING "specifies the suffix for the library directory to be used when building 32-bit library")
|
|
|
|
set(LIB_SUFFIX_64 "" CACHE STRING "specifies the suffix for the library directory to be used when building 64-bit library")
|
2019-02-06 17:30:52 +01:00
|
|
|
if (LIB_SUFFIX_64 AND CMAKE_SIZEOF_VOID_P MATCHES "8")
|
2018-09-16 00:25:04 +02:00
|
|
|
set(SELECTED_LIB_SUFFIX "${LIB_SUFFIX_64}")
|
2019-02-06 17:30:52 +01:00
|
|
|
elseif (LIB_SUFFIX_32 AND CMAKE_SIZEOF_VOID_P MATCHES "4")
|
2018-09-16 00:25:04 +02:00
|
|
|
set(SELECTED_LIB_SUFFIX "${LIB_SUFFIX_32}")
|
2019-02-06 17:30:52 +01:00
|
|
|
endif ()
|
2018-09-16 00:25:04 +02:00
|
|
|
|
2017-02-11 02:30:46 +01:00
|
|
|
set(BASIC_PROJECT_CONFIG_DONE YES)
|