Browse Source

Apply cmake-format

sendfile
Martchus 3 years ago
parent
commit
6489cae19e
  1. 21
      cmake/modules/3rdParty.cmake
  2. 14
      cmake/modules/LibraryTarget.cmake

21
cmake/modules/3rdParty.cmake

@ -172,7 +172,7 @@ function (use_target)
set("${ARGS_LIBRARIES_VARIABLE}" "${${ARGS_LIBRARIES_VARIABLE}};${ARGS_TARGET_NAME}" PARENT_SCOPE)
endfunction ()
function(use_pkg_config_module)
function (use_pkg_config_module)
# parse and validate arguments
parse_arguments_for_use_functions(${ARGN})
if (NOT ARGS_PKG_CONFIG_MODULES)
@ -202,16 +202,23 @@ 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_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} PROPERTY INTERFACE_LINK_OPTIONS "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_LDFLAGS_OTHER}")
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}")
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}
PROPERTY INTERFACE_LINK_OPTIONS "${PKG_CHECK_MODULES_RESULT${PKG_CONFIG_CHECK_SUFFIX}_LDFLAGS_OTHER}")
set("${ARGS_PKG_CONFIG_MODULES_VARIABLE}" "${${ARGS_PKG_CONFIG_MODULES_VARIABLE}};${ARGS_TARGET_NAME}" PARENT_SCOPE)
set("${ARGS_LIBRARIES_VARIABLE}" "${${ARGS_LIBRARIES_VARIABLE}};${ARGS_TARGET_NAME}" PARENT_SCOPE)
string(REPLACE "::" "_" TARGET_VARNAME "${ARGS_TARGET_NAME}")
string(REPLACE "::"
"_"
TARGET_VARNAME
"${ARGS_TARGET_NAME}")
set("PKG_CONFIG_${TARGET_VARNAME}" "${ARGS_PKG_CONFIG_MODULES}" PARENT_SCOPE)
endfunction()
endfunction ()
# skip subsequent configuration if only the function includes are wanted
if (META_NO_3RDPARTY_CONFIG)

14
cmake/modules/LibraryTarget.cmake

@ -200,11 +200,17 @@ if (META_HEADER_ONLY_LIB)
endif ()
# generate CMake code to configure CMake-target to pkg-config module mapping
set(TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING "set(PKG_CONFIG_${META_TARGET_NAME} \"${META_PROJECT_NAME}${META_CONFIG_SUFFIX}\")")
set(TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING
"set(PKG_CONFIG_${META_TARGET_NAME} \"${META_PROJECT_NAME}${META_CONFIG_SUFFIX}\")")
foreach (INTERFACE_REQUIRED_PKG_CONFIG_MODULE ${INTERFACE_REQUIRED_PKG_CONFIG_MODULES})
string(REPLACE "::" "_" INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME "${INTERFACE_REQUIRED_PKG_CONFIG_MODULE}")
set(TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING
"${TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING}\nset(PKG_CONFIG_${INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME} \"${PKG_CONFIG_${INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME}}\")")
string(REPLACE "::"
"_"
INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME
"${INTERFACE_REQUIRED_PKG_CONFIG_MODULE}")
set(
TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING
"${TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING}\nset(PKG_CONFIG_${INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME} \"${PKG_CONFIG_${INTERFACE_REQUIRED_PKG_CONFIG_MODULE_VARNAME}}\")"
)
endforeach ()
# create the CMake package config file from template

Loading…
Cancel
Save