Browse Source

Apply cmake-format

sendfile
Martchus 2 years ago
parent
commit
99bc257755
  1. 3
      CMakeLists.txt
  2. 8
      cmake/modules/3rdParty.cmake
  3. 46
      cmake/modules/AppTarget.cmake
  4. 46
      cmake/modules/BasicConfig.cmake
  5. 3
      cmake/modules/Doxygen.cmake
  6. 69
      cmake/modules/LibraryTarget.cmake
  7. 3
      cmake/modules/ShellCompletion.cmake
  8. 27
      cmake/modules/TestTarget.cmake
  9. 9
      cmake/modules/WindowsResources.cmake

3
CMakeLists.txt

@ -163,7 +163,8 @@ else ()
endif ()
# configure required libraries for std::filesystem
option(USE_STANDARD_FILESYSTEM "uses std::filesystem; if disabled Bash completion for files and directories is not working" ON)
option(USE_STANDARD_FILESYSTEM "uses std::filesystem; if disabled Bash completion for files and directories is not working"
ON)
if (USE_STANDARD_FILESYSTEM)
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_USE_STANDARD_FILESYSTEM)
use_standard_filesystem()

8
cmake/modules/3rdParty.cmake

@ -247,10 +247,12 @@ function (use_pkg_config_module)
else ()
set(PKG_CONFIG_CHECK_SUFFIX "")
endif ()
set_property(
TARGET ${ARGS_TARGET_NAME}
PROPERTY INTERFACE_LINK_LIBRARIES "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_LINK_LIBRARIES}")
set_property(TARGET ${ARGS_TARGET_NAME}
PROPERTY INTERFACE_LINK_LIBRARIES "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_LINK_LIBRARIES}")
set_property(TARGET ${ARGS_TARGET_NAME}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_INCLUDE_DIRS}")
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
"${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_INCLUDE_DIRS}")
set_property(TARGET ${ARGS_TARGET_NAME}
PROPERTY INTERFACE_COMPILE_OPTIONS "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_CFLAGS_OTHER}")
set_property(TARGET ${ARGS_TARGET_NAME}

46
cmake/modules/AppTarget.cmake

@ -61,29 +61,34 @@ set_target_properties(${META_TARGET_NAME}
"${AUTOGEN_DEPS}")
if ("${GUI_TYPE}" STREQUAL "MACOSX_BUNDLE")
set_target_properties(${META_TARGET_NAME} PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME ${META_TARGET_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER ${META_TARGET_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION ${META_APP_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING ${META_APP_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${META_APP_VERSION}
)
set_target_properties(${META_TARGET_NAME}
PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME
${META_TARGET_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER
${META_TARGET_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION
${META_APP_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING
${META_APP_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING
${META_APP_VERSION})
find_program(PNG2ICNS_BIN png2icns)
if (PNG2ICNS_BIN AND EXISTS "${PNG_ICON_PATH}")
set(RESOURCES_DIR "${CMAKE_CURRENT_BINARY_DIR}/${META_TARGET_NAME}.app/Contents/Resources")
set(MACOSX_ICON_PATH "${RESOURCES_DIR}/${META_PROJECT_NAME}.icns" )
set(MACOSX_ICON_PATH "${RESOURCES_DIR}/${META_PROJECT_NAME}.icns")
add_custom_command(OUTPUT "${MACOSX_ICON_PATH}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${RESOURCES_DIR}"
COMMAND "${CMAKE_COMMAND}"
-E
make_directory
"${RESOURCES_DIR}"
COMMAND ${PNG2ICNS_BIN} "${MACOSX_ICON_PATH}" "${PNG_ICON_PATH}"
DEPENDS "${PNG_ICON_PATH}")
message(STATUS "Generating macOS icon from \"${PNG_ICON_PATH}\" via ${PNG2ICNS_BIN}.")
set_target_properties(${META_TARGET_NAME} PROPERTIES
MACOSX_BUNDLE_ICON_FILE ${META_PROJECT_NAME}.icns)
target_sources(${META_TARGET_NAME}
PRIVATE "${MACOSX_ICON_PATH}")
set_target_properties(${META_TARGET_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE ${META_PROJECT_NAME}.icns)
target_sources(${META_TARGET_NAME} PRIVATE "${MACOSX_ICON_PATH}")
endif ()
endif()
endif ()
# add install targets
if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
@ -105,7 +110,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-binary)
add_custom_target(install-binary
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=binary -P
-DCMAKE_INSTALL_COMPONENT=binary
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
add_dependencies(install-binary ${META_TARGET_NAME})
@ -128,14 +134,16 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-desktop)
add_custom_target(install-desktop
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=desktop -P
-DCMAKE_INSTALL_COMPONENT=desktop
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
add_dependencies(install-desktop ${META_TARGET_NAME})
if (NOT TARGET install-appimage)
add_custom_target(install-appimage
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=appimage -P
-DCMAKE_INSTALL_COMPONENT=appimage
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
add_dependencies(install-appimage ${META_TARGET_NAME})
@ -144,7 +152,9 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-binary-strip)
add_custom_target(install-binary-strip
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P
-DCMAKE_INSTALL_DO_STRIP=1
-DCMAKE_INSTALL_COMPONENT=binary
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
add_dependencies(install-binary-strip ${META_TARGET_NAME})

46
cmake/modules/BasicConfig.cmake

@ -12,9 +12,9 @@ if (NOT META_APP_DESCRIPTION)
message(FATAL_ERROR "No project name (META_APP_DESCRIPTION) specified.")
endif ()
# set project name (displayed in Qt Creator)
# 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).
# set project name (displayed in Qt Creator) 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).
message(STATUS "Configuring project ${META_PROJECT_NAME}")
project(${META_PROJECT_NAME})
@ -145,10 +145,16 @@ option(
ON)
if (APPEND_GIT_REVISION)
find_program(GIT_BIN git)
execute_process(COMMAND ${GIT_BIN} rev-list --count HEAD
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
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"
@ -293,8 +299,11 @@ set(FORMATABLE_FILES_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_MO
# add command for symlinking clang-{format,tidy} rules so the tools can find it
if (EXISTS "${CLANG_FORMAT_RULES}")
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/.clang-format"
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CLANG_FORMAT_RULES}"
"${CMAKE_CURRENT_SOURCE_DIR}/.clang-format"
COMMAND "${CMAKE_COMMAND}"
-E
create_symlink
"${CLANG_FORMAT_RULES}"
"${CMAKE_CURRENT_SOURCE_DIR}/.clang-format"
COMMENT "Linking coding style from ${CLANG_FORMAT_RULES}")
else ()
message(WARNING "Format rules for clang-format not found.")
@ -313,7 +322,10 @@ if (NOT META_NO_TIDY AND CLANG_FORMAT_ENABLED AND FORMATABLE_FILES AND EXISTS "$
message(FATAL_ERROR "Unable to add tidy target; clang-format not found")
endif ()
add_custom_target("${META_TARGET_NAME}_tidy"
COMMAND "${CLANG_FORMAT_BIN}" -style=file -i ${FORMATABLE_FILES}
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")
@ -324,7 +336,10 @@ if (NOT META_NO_TIDY AND CLANG_FORMAT_ENABLED AND FORMATABLE_FILES AND EXISTS "$
# also add a test to verify whether sources are tidy
add_test(NAME "${META_TARGET_NAME}_tidy_test"
COMMAND "${CLANG_FORMAT_BIN}" -output-replacements-xml -style=file ${FORMATABLE_FILES}
COMMAND "${CLANG_FORMAT_BIN}"
-output-replacements-xml
-style=file
${FORMATABLE_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
list(APPEND CHECK_TARGET_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.clang-format")
set_tests_properties("${META_TARGET_NAME}_tidy_test"
@ -348,7 +363,10 @@ if (NOT META_NO_TIDY AND CMAKE_FORMAT_ENABLED AND FORMATABLE_FILES_CMAKE)
--autosort=False)
endif ()
add_custom_target("${META_TARGET_NAME}_cmake_tidy"
COMMAND "${CMAKE_FORMAT_BIN}" --in-place ${META_CMAKE_FORMAT_OPTIONS} ${FORMATABLE_FILES_CMAKE}
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}")
@ -417,7 +435,10 @@ if (NOT META_NO_STATIC_ANALYSIS AND FORMATABLE_FILES)
list(APPEND CLANG_TIDY_SYMBOLIC_OUTPUT_FILES "${SYMBOLIC_OUTPUT_FILE}")
add_custom_command(OUTPUT "${SYMBOLIC_OUTPUT_FILE}"
COMMAND "${CLANG_TIDY_BIN}" ${FILE} -- ${CLANG_TIDY_CXX_FLAGS}
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
@ -481,7 +502,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-extra-files)
add_custom_target(install-extra-files
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=extra-files -P
-DCMAKE_INSTALL_COMPONENT=extra-files
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
endif ()

3
cmake/modules/Doxygen.cmake

@ -74,7 +74,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-api-doc)
add_custom_target(install-api-doc
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=api-doc -P
-DCMAKE_INSTALL_COMPONENT=api-doc
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
endif ()

69
cmake/modules/LibraryTarget.cmake

@ -289,8 +289,7 @@ macro (compute_dependencies_for_package_config
set(${OUTPUT_VAR_PKGS} "${${OUTPUT_VAR_PKGS}} ${PKG_CONFIG_MODULE}")
endforeach ()
elseif (TARGET "${DEPENDENCY}")
# find the raw-library flags for the dependency
# add interface link libraries of the target
# find the raw-library flags for the dependency add interface link libraries of the target
get_target_property("${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES" "${DEPENDENCY}" "INTERFACE_LINK_LIBRARIES")
set(${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_EXISTING FALSE)
set(${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_TARGETS)
@ -303,7 +302,10 @@ macro (compute_dependencies_for_package_config
set(${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_EXISTING TRUE)
endif ()
endforeach ()
compute_dependencies_for_package_config("${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_TARGETS" "${OUTPUT_VAR_PKGS}" "${OUTPUT_VAR_LIBS}" NO)
compute_dependencies_for_package_config("${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_TARGETS"
"${OUTPUT_VAR_PKGS}"
"${OUTPUT_VAR_LIBS}"
NO)
if (${DEPENDENCY_VARNAME}_INTERFACE_LINK_LIBRARIES_EXISTING)
continue()
endif ()
@ -318,9 +320,15 @@ macro (compute_dependencies_for_package_config
if (NOT HAS_LIBRARY_LOCATION AND META_CURRENT_CONFIGURATION)
get_target_property("${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}" "${DEPENDENCY}"
"IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}")
# check whether path points to the build directory; libraries must not be referenced using their build location
string(FIND "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}}" "${CMAKE_CURRENT_BINARY_DIR}" BINARY_DIR_INDEX)
if (NOT BINARY_DIR_INDEX EQUAL 0 AND EXISTS "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}}")
# check whether path points to the build directory; libraries must not be referenced using their build
# location
string(FIND "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}}"
"${CMAKE_CURRENT_BINARY_DIR}" BINARY_DIR_INDEX)
if (NOT
BINARY_DIR_INDEX
EQUAL
0
AND EXISTS "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}}")
set(${OUTPUT_VAR_LIBS}
"${${OUTPUT_VAR_LIBS}} ${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION_${META_CURRENT_CONFIGURATION}}")
set(HAS_LIBRARY_LOCATION YES)
@ -328,7 +336,8 @@ macro (compute_dependencies_for_package_config
endif ()
if (NOT HAS_LIBRARY_LOCATION)
get_target_property("${DEPENDENCY_VARNAME}_IMPORTED_LOCATION" "${DEPENDENCY}" IMPORTED_LOCATION)
# check whether path points to the build directory; libraries must not be referenced using their build location
# check whether path points to the build directory; libraries must not be referenced using their build
# location
string(FIND "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}" BINARY_DIR_INDEX)
if (NOT BINARY_DIR_INDEX EQUAL 0 AND EXISTS "${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION}")
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} ${${DEPENDENCY_VARNAME}_IMPORTED_LOCATION}")
@ -342,16 +351,26 @@ macro (compute_dependencies_for_package_config
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} -l${DEPENDENCY}")
endif ()
# add libraries required by the imported target
get_target_property("${DEPENDENCY_VARNAME}_IMPORTED_LINK_INTERFACE_LIBRARIES" "${DEPENDENCY}" "IMPORTED_LINK_INTERFACE_LIBRARIES")
compute_dependencies_for_package_config("${DEPENDENCY_VARNAME}_IMPORTED_LINK_INTERFACE_LIBRARIES" "${OUTPUT_VAR_PKGS}" "${OUTPUT_VAR_LIBS}" NO)
get_target_property("${DEPENDENCY_VARNAME}_IMPORTED_LINK_INTERFACE_LIBRARIES" "${DEPENDENCY}"
"IMPORTED_LINK_INTERFACE_LIBRARIES")
compute_dependencies_for_package_config("${DEPENDENCY_VARNAME}_IMPORTED_LINK_INTERFACE_LIBRARIES"
"${OUTPUT_VAR_PKGS}"
"${OUTPUT_VAR_LIBS}"
NO)
else ()
# add raw dependency
set(${OUTPUT_VAR_LIBS} "${${OUTPUT_VAR_LIBS}} ${DEPENDENCY}")
endif ()
endforeach ()
endmacro ()
compute_dependencies_for_package_config(META_PUBLIC_LIB_DEPENDS META_PUBLIC_PC_PKGS META_PUBLIC_LIB_DEPENDS_FOR_PC YES)
compute_dependencies_for_package_config(META_PRIVATE_LIB_DEPENDS META_PRIVATE_PC_PKGS META_PRIVATE_LIB_DEPENDS_FOR_PC YES)
compute_dependencies_for_package_config(META_PUBLIC_LIB_DEPENDS
META_PUBLIC_PC_PKGS
META_PUBLIC_LIB_DEPENDS_FOR_PC
YES)
compute_dependencies_for_package_config(META_PRIVATE_LIB_DEPENDS
META_PRIVATE_PC_PKGS
META_PRIVATE_LIB_DEPENDS_FOR_PC
YES)
if (NOT META_HEADER_ONLY_LIB)
set(META_PUBLIC_LIB_DEPENDS_FOR_PC " -l${META_TARGET_NAME}${META_PUBLIC_LIB_DEPENDS_FOR_PC}")
endif ()
@ -377,7 +396,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-cmake-config)
add_custom_target(install-cmake-config
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cmake-config -P
-DCMAKE_INSTALL_COMPONENT=cmake-config
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -388,7 +408,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-pkg-config)
add_custom_target(install-pkg-config
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=pkg-config -P
-DCMAKE_INSTALL_COMPONENT=pkg-config
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -396,7 +417,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-binary)
add_custom_target(install-binary
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=binary -P
-DCMAKE_INSTALL_COMPONENT=binary
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -404,7 +426,9 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-binary-strip)
add_custom_target(install-binary-strip
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P
-DCMAKE_INSTALL_DO_STRIP=1
-DCMAKE_INSTALL_COMPONENT=binary
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -478,7 +502,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-header)
add_custom_target(install-header
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=header -P
-DCMAKE_INSTALL_COMPONENT=header
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
endif ()
@ -491,7 +516,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-cmake-modules)
add_custom_target(install-cmake-modules
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cmake-modules -P
-DCMAKE_INSTALL_COMPONENT=cmake-modules
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -503,7 +529,8 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (NOT TARGET install-cmake-templates)
add_custom_target(install-cmake-templates
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cmake-templates -P
-DCMAKE_INSTALL_COMPONENT=cmake-templates
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
@ -553,16 +580,14 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
if (BUILD_SHARED_LIBS AND NOT META_HEADER_ONLY_LIB)
add_custom_target(
install-${META_TARGET_NAME}-mingw-w64-importlib-strip
COMMAND "${STRIP_BINARY_PATH}"
-g
COMMAND "${STRIP_BINARY_PATH}" -g
"\$\{DESTDIR\}\$\{DESTDIR:+/\}${CMAKE_INSTALL_PREFIX}/lib/lib${META_TARGET_NAME}.dll.a")
add_dependencies(install-${META_TARGET_NAME}-mingw-w64-importlib-strip install-binary-strip)
add_dependencies(install-mingw-w64-strip install-${META_TARGET_NAME}-mingw-w64-importlib-strip)
endif ()
if (BUILD_STATIC_LIBS AND NOT META_HEADER_ONLY_LIB)
add_custom_target(install-${META_TARGET_NAME}-mingw-w64-staticlib-strip
COMMAND "${STRIP_BINARY_PATH}"
-g
COMMAND "${STRIP_BINARY_PATH}" -g
"\$\{DESTDIR\}\$\{DESTDIR:+/\}${CMAKE_INSTALL_PREFIX}/lib/lib${META_TARGET_NAME}.a")
add_dependencies(install-${META_TARGET_NAME}-mingw-w64-staticlib-strip install-binary-strip)
add_dependencies(install-mingw-w64-strip install-${META_TARGET_NAME}-mingw-w64-staticlib-strip)

3
cmake/modules/ShellCompletion.cmake

@ -26,7 +26,8 @@ if (BASH_COMPLETION_ENABLED)
if (NOT TARGET install-bash-completion)
add_custom_target(install-bash-completion
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=bash-completion -P
-DCMAKE_INSTALL_COMPONENT=bash-completion
-P
"${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif ()
endif ()

27
cmake/modules/TestTarget.cmake

@ -181,7 +181,8 @@ if (NOT META_TEST_TARGET_IS_MANUAL)
-p
"${CMAKE_CURRENT_SOURCE_DIR}/testfiles"
-w
"${CMAKE_CURRENT_BINARY_DIR}/testworkingdir" ${RUN_TESTS_APPLICATION_ARGS})
"${CMAKE_CURRENT_BINARY_DIR}/testworkingdir"
${RUN_TESTS_APPLICATION_ARGS})
endif ()
# enable source code based coverage analysis using clang
@ -219,7 +220,8 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE)
-p
"${CMAKE_CURRENT_SOURCE_DIR}/testfiles"
-w
"${CMAKE_CURRENT_BINARY_DIR}/testworkingdir" ${RUN_TESTS_APPLICATION_ARGS}
"${CMAKE_CURRENT_BINARY_DIR}/testworkingdir"
${RUN_TESTS_APPLICATION_ARGS}
COMMENT "Executing ${META_TARGET_NAME}_tests to generate raw profiling data for source-based coverage report"
DEPENDS "${META_TARGET_NAME}_tests")
@ -271,8 +273,11 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE)
list(APPEND LLVM_COV_ADDITIONAL_OPTIONS -show-functions)
endif ()
add_custom_command(OUTPUT "${COVERAGE_REPORT_FILE}"
COMMAND "${LLVM_COV_BIN}" report
-format=text -stats -instr-profile
COMMAND "${LLVM_COV_BIN}"
report
-format=text
-stats
-instr-profile
"${LLVM_PROFILE_DATA_FILE}"
${LLVM_COV_ADDITIONAL_OPTIONS}
${LLVM_COV_TARGET_FILE}
@ -291,8 +296,11 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE)
# generate coverage report with statistics per file (only possible with LLVM 5 if source files are specified)
if (LLVM_COV_VERSION GREATER_EQUAL 5.0.0)
add_custom_command(OUTPUT "${COVERAGE_PER_FILE_REPORT_FILE}"
COMMAND "${LLVM_COV_BIN}" report
-format=text -stats -instr-profile
COMMAND "${LLVM_COV_BIN}"
report
-format=text
-stats
-instr-profile
"${LLVM_PROFILE_DATA_FILE}"
${LLVM_COV_TARGET_FILE}
${HEADER_FILES}
@ -336,8 +344,11 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE)
# generate HTML document showing covered/uncovered code
add_custom_command(OUTPUT "${COVERAGE_HTML_REPORT_FILE}"
COMMAND "${LLVM_COV_BIN}" show
-project-title="${META_APP_NAME}" -format=html -instr-profile
COMMAND "${LLVM_COV_BIN}"
show
-project-title="${META_APP_NAME}"
-format=html
-instr-profile
"${LLVM_PROFILE_DATA_FILE}"
${LLVM_COV_TARGET_FILE}
${HEADER_FILES}

9
cmake/modules/WindowsResources.cmake

@ -39,8 +39,13 @@ if (WINDOWS_ICON_ENABLED)
set(WINDOWS_ICON_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources/${META_PROJECT_NAME}.ico")
set(WINDOWS_ICON_RC_ENTRY "IDI_ICON1 ICON DISCARDABLE \"${WINDOWS_ICON_PATH}\"")
add_custom_command(OUTPUT "${WINDOWS_ICON_PATH}"
COMMAND ${FFMPEG_BIN} -y -i "${PNG_ICON_PATH}" -vf crop=${PNG_ICON_CROP},scale=64:64
"${WINDOWS_ICON_PATH}"
COMMAND ${FFMPEG_BIN}
-y
-i
"${PNG_ICON_PATH}"
-vf
crop=${PNG_ICON_CROP},scale=64:64
"${WINDOWS_ICON_PATH}"
DEPENDS "${PNG_ICON_PATH}")
set_source_files_properties("${WINDOWS_RC_FILE}"
PROPERTIES

Loading…
Cancel
Save