Browse Source

Reformat CMake files with cmake-format 0.6.7

charconv
Martchus 2 years ago
parent
commit
f5e275288d
  1. 18
      CMakeLists.txt
  2. 2
      cmake/modules/LibraryTarget.cmake
  3. 20
      cmake/modules/TestTarget.cmake
  4. 3
      cmake/modules/WindowsResources.cmake

18
CMakeLists.txt

@ -150,10 +150,8 @@ if (USE_NATIVE_FILE_BUFFER)
message(STATUS "Using boost::iostreams::stream_buffer<boost::iostreams::file_descriptor_sink> for NativeFileStream")
use_package(TARGET_NAME Boost::iostreams PACKAGE_NAME Boost PACKAGE_ARGS "REQUIRED;COMPONENTS;iostreams")
foreach (NATIVE_FILE_STREAM_IMPL_FILE ${NATIVE_FILE_STREAM_IMPL_FILES})
set_property(
SOURCE ${NATIVE_FILE_STREAM_IMPL_FILE}
APPEND
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_USE_BOOST_IOSTREAMS)
set_property(SOURCE ${NATIVE_FILE_STREAM_IMPL_FILE} APPEND PROPERTY COMPILE_DEFINITIONS
${META_PROJECT_VARNAME}_USE_BOOST_IOSTREAMS)
endforeach ()
endif ()
else ()
@ -179,10 +177,8 @@ endif ()
# configure whether escape codes should be enabled by default
option(ENABLE_ESCAPE_CODES_BY_DEAULT "enables usage of escape codes by default" ON)
if (ENABLE_ESCAPE_CODES_BY_DEAULT)
set_property(
SOURCE application/argumentparser.cpp io/ansiescapecodes.cpp tests/argumentparsertests.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_ESCAPE_CODES_ENABLED_BY_DEFAULT)
set_property(SOURCE application/argumentparser.cpp io/ansiescapecodes.cpp tests/argumentparsertests.cpp APPEND
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_ESCAPE_CODES_ENABLED_BY_DEFAULT)
else ()
message(STATUS "Disabling use of escape codes by default.")
endif ()
@ -190,10 +186,8 @@ endif ()
# configure use of thread_local
option(ENABLE_THREAD_LOCAL "enables use of Thread-Local Storage" ON)
if (NOT ENABLE_THREAD_LOCAL)
set_property(
SOURCE conversion/stringconversion.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME}_NO_THREAD_LOCAL)
set_property(SOURCE conversion/stringconversion.cpp APPEND PROPERTY COMPILE_DEFINITIONS
${META_PROJECT_VARNAME}_NO_THREAD_LOCAL)
endif ()
# include modules to apply configuration

2
cmake/modules/LibraryTarget.cmake

@ -243,7 +243,7 @@ foreach (CONFIG_TARGET ${CONFIG_TARGETS})
LIB_INSTALL_DESTINATION)
endforeach ()
list(APPEND CMAKE_CONFIG_FILES "${CMAKE_CURRENT_BINARY_DIR}/${META_PROJECT_NAME}${META_CONFIG_SUFFIX}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${META_PROJECT_NAME}${META_CONFIG_SUFFIX}ConfigVersion.cmake")
"${CMAKE_CURRENT_BINARY_DIR}/${META_PROJECT_NAME}${META_CONFIG_SUFFIX}ConfigVersion.cmake")
# write the CMake version config file
write_basic_package_version_file(

20
cmake/modules/TestTarget.cmake

@ -104,8 +104,8 @@ if (META_PROJECT_IS_LIBRARY)
message(STATUS "Linking test target against ${META_TARGET_NAME}")
endif ()
# create a 'testlib' and link tests against it when testing an application an the tests need to call internal
# functions of the application
# create a 'testlib' and link tests against it when testing an application an the tests need to call internal functions of
# the application
if (META_PROJECT_IS_APPLICATION AND LINK_TESTS_AGAINST_APP_TARGET)
# create target for the 'testlib'
set(TESTLIB_FILES ${HEADER_FILES} ${SRC_FILES} ${WIDGETS_FILES} ${QML_FILES} ${RES_FILES} ${QM_FILES})
@ -139,8 +139,7 @@ if (META_PROJECT_IS_APPLICATION AND LINK_TESTS_AGAINST_APP_TARGET)
if (CPP_UNIT_CONFIG_${META_PROJECT_NAME}_FOUND)
target_include_directories(${META_TARGET_NAME}_testlib
PRIVATE "${CPP_UNIT_CONFIG_${META_PROJECT_NAME}_INCLUDE_DIRS}")
target_compile_options(${META_TARGET_NAME}_testlib
PRIVATE "${CPP_UNIT_CONFIG_${META_PROJECT_NAME}_CFLAGS_OTHER}")
target_compile_options(${META_TARGET_NAME}_testlib PRIVATE "${CPP_UNIT_CONFIG_${META_PROJECT_NAME}_CFLAGS_OTHER}")
endif ()
# link tests against it
list(APPEND TEST_LIBRARIES ${META_TARGET_NAME}_testlib)
@ -168,11 +167,9 @@ target_compile_options(
PRIVATE "${META_PRIVATE_COMPILE_OPTIONS}")
set_target_properties(
${META_TARGET_NAME}_tests
PROPERTIES CXX_STANDARD "${META_CXX_STANDARD}"
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
LINK_SEARCH_START_STATIC ${STATIC_LINKAGE}
LINK_SEARCH_END_STATIC ${STATIC_LINKAGE})
PROPERTIES CXX_STANDARD "${META_CXX_STANDARD}" C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden
LINK_SEARCH_START_STATIC ${STATIC_LINKAGE} LINK_SEARCH_END_STATIC ${STATIC_LINKAGE})
# make the test recognized by ctest
unset(RUN_TESTS_APPLICATION_ARG)
@ -226,9 +223,8 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE)
# merge profiling data
add_custom_command(
OUTPUT "${LLVM_PROFILE_DATA_FILE}"
COMMAND
cat "${LLVM_PROFILE_RAW_LIST_FILE}" | xargs "${LLVM_PROFDATA_BIN}" merge -o "${LLVM_PROFILE_DATA_FILE}"
-sparse "${LLVM_PROFILE_RAW_FILE}"
COMMAND cat "${LLVM_PROFILE_RAW_LIST_FILE}" | xargs "${LLVM_PROFDATA_BIN}" merge -o "${LLVM_PROFILE_DATA_FILE}"
-sparse "${LLVM_PROFILE_RAW_FILE}"
COMMENT "Generating profiling data for source-based coverage report"
DEPENDS "${LLVM_PROFILE_RAW_FILE}" "${LLVM_PROFILE_RAW_LIST_FILE}")

3
cmake/modules/WindowsResources.cmake

@ -42,8 +42,7 @@ if (WINDOWS_ICON_ENABLED)
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 OBJECT_DEPENDS "${WINDOWS_ICON_PATH}")
message(STATUS "Generating Windows icon from \"${PNG_ICON_PATH}\" via ${FFMPEG_BIN}.")

Loading…
Cancel
Save