]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake/AddCephTest: use namespaced Catch2 imported targets 69165/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 29 May 2026 10:19:18 +0000 (18:19 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Fri, 29 May 2026 10:30:10 +0000 (18:30 +0800)
commit66a775ae90fe74dcc9c4ab4d9645c2100f423e1f
treec4ac72392b4dbf758e7a9ebce3d182e9c2e4bc36
parentce220cc902e91fe203513e7beac7982e2c2538d4
cmake/AddCephTest: use namespaced Catch2 imported targets

AddCephTest.cmake links the bare target names Catch2 / Catch2WithMain.
With WITH_SYSTEM_CATCH2=ON, CPM resolves Catch2 via find_package(),
which only exports the namespaced IMPORTED targets Catch2::Catch2 /
Catch2::Catch2WithMain. CMake then treats the bare names as plain
library names and the link fails with -lCatch2WithMain, since the
physical library is named libCatch2Main (OUTPUT_NAME "Catch2Main").

Use the namespaced names. Catch2 exports them as ALIASes in the bundled
(CPM subproject) build too, so the default path keeps working.

Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
cmake/modules/AddCephTest.cmake