]> https://gitweb.dealii.org/ - dealii.git/commit
CMake: fix "Release" and "Debug" only configure for CMake 3.30 17217/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 5 Jul 2024 22:52:04 +0000 (17:52 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 5 Jul 2024 22:56:20 +0000 (17:56 -0500)
commit315a3b37d968f40cd4c5548d9a5e0d06c5f4113b
tree39ffdd4bd72fd83d297049064e2dbd4496007aba
parent5f65ad8abc0a076e2c7d11b8597c668566be6361
CMake: fix "Release" and "Debug" only configure for CMake 3.30

Beginning with version 3.30 CMake makes it an error to specify a
nonexistent target in a call to target_link_libraries() even if that
target is never used internally and only part of the exported interface.
This is a problem as we want to add configuration dependent targets with
a generator expression that are later exported:

  $<$<CONFIG:Release>:dealii::dealii_release> (...)

Note that we cannot simply use $<$<CONFIG:Release>:dealii_release> as
CMake then does not complete "dealii_release" to "dealii::dealii_release"
upon target export...

As a workaround we create alias targets with the "dealii::" namespace,
which makes the call to target_link_libraries() succeed.
source/CMakeLists.txt

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.