]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: rename macro to insource_setup_target()
authorMatthias Maier <tamiko@43-1.org>
Tue, 29 Nov 2022 16:16:37 +0000 (10:16 -0600)
committerMatthias Maier <tamiko@43-1.org>
Tue, 29 Nov 2022 16:16:37 +0000 (10:16 -0600)
cmake/macros/macro_insource_setup_target.cmake [moved from cmake/macros/macro_deal_ii_insource_setup_target.cmake with 84% similarity]
examples/CMakeLists.txt
tests/quick_tests/CMakeLists.txt

similarity index 84%
rename from cmake/macros/macro_deal_ii_insource_setup_target.cmake
rename to cmake/macros/macro_insource_setup_target.cmake
index 0e11f0951afdc29e02344a1dec1ef7e23afd1412..5f61cf3caadb529ab5de1fb046c4d61be8f07199 100644 (file)
 ## ---------------------------------------------------------------------
 
 #
-# 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()
index f12009ea79f4345c3cb4c500ea06b52badc708a3..e395a98e756188bd056ae8df3b35888fd1578d74 100644 (file)
@@ -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
index 4090328b7237d308f37b40a4f5c98fe72a0abc49..4ebe62aeac41c53687aac70a98a2cbc3dc1e6423 100644 (file)
@@ -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})

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.