From: Matthias Maier Date: Tue, 29 Nov 2022 16:16:37 +0000 (-0600) Subject: CMake: rename macro to insource_setup_target() X-Git-Tag: v9.5.0-rc1~789^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b78f762e1094531351a864bb2cd7289fa7a4a5b;p=dealii.git CMake: rename macro to insource_setup_target() --- diff --git a/cmake/macros/macro_deal_ii_insource_setup_target.cmake b/cmake/macros/macro_insource_setup_target.cmake similarity index 84% rename from cmake/macros/macro_deal_ii_insource_setup_target.cmake rename to cmake/macros/macro_insource_setup_target.cmake index 0e11f0951a..5f61cf3caa 100644 --- a/cmake/macros/macro_deal_ii_insource_setup_target.cmake +++ b/cmake/macros/macro_insource_setup_target.cmake @@ -14,17 +14,16 @@ ## --------------------------------------------------------------------- # -# This file provides an insource version of the DEAL_II_SETUP_TARGET macro. +# This file provides an "insource" version of the DEAL_II_SETUP_TARGET macro. # # Usage: -# deal_ii_insource_setup_target(target build) +# insource_setup_target(target build) # # This appends necessary include directories, linker flags, compile # definitions and the deal.II library link interface to the given target. # -# -macro(deal_ii_insource_setup_target _target _build) +function(insource_setup_target _target _build) string(TOLOWER ${_build} _build_lowercase) set_target_properties(${_target} PROPERTIES @@ -60,12 +59,11 @@ macro(deal_ii_insource_setup_target _target _build) target_compile_definitions(${_target} PUBLIC ${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}} ) - endif() -get_property(_type TARGET ${_target} PROPERTY TYPE) -if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") - target_link_libraries(${_target} ${DEAL_II_NAMESPACE}_${_build_lowercase}) -endif() + get_property(_type TARGET ${_target} PROPERTY TYPE) + if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") + target_link_libraries(${_target} ${DEAL_II_NAMESPACE}_${_build_lowercase}) + endif() -endmacro() +endfunction() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index f12009ea79..e395a98e75 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -90,7 +90,7 @@ if(DEAL_II_COMPONENT_EXAMPLES) foreach(_build ${DEAL_II_BUILD_TYPES}) string(TOLOWER ${_build} _build_lowercase) add_executable(${_name}.${_build_lowercase} ${_step}) - deal_ii_insource_setup_target(${_name}.${_build_lowercase} ${_build}) + insource_setup_target(${_name}.${_build_lowercase} ${_build}) set_target_properties(${_name}.${_build_lowercase} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" @@ -129,7 +129,7 @@ if(DEAL_II_COMPONENT_EXAMPLES) foreach(_build ${DEAL_II_BUILD_TYPES}) string(TOLOWER ${_build} _build_lowercase) add_executable(${_name}.${_build_lowercase} ${_step}) - deal_ii_insource_setup_target(${_name}.${_build_lowercase} ${_build}) + insource_setup_target(${_name}.${_build_lowercase} ${_build}) set_target_properties(${_name}.${_build_lowercase} PROPERTIES diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 4090328b72..4ebe62aeac 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -37,7 +37,7 @@ macro(make_quicktest test_basename build_name mpi_run) set(_target ${test_basename}.${_build_lowercase}) list(APPEND ALL_TESTS "${_target}") add_executable(${_target} EXCLUDE_FROM_ALL ${test_basename}.cc) - deal_ii_insource_setup_target(${_target} ${build_name}) + insource_setup_target(${_target} ${build_name}) if("${mpi_run}" STREQUAL "") set(_command ${_target})