cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
authorAndreas Schneider <asn@samba.org>
Fri, 17 Feb 2023 16:51:27 +0000 (17:51 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 17 Feb 2023 16:57:59 +0000 (17:57 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
tests/CMakeLists.txt

index 635e86e17a017d1cb306b3707ff8778a264dddc4..68e050eb6b68d850fa99112aff40b60b43606090 100644 (file)
@@ -1,5 +1,9 @@
 project(tests C)
 
+if (TARGET cmocka::cmocka)
+    set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
 add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
 target_compile_options(uwrap_fake_socket_wrapper
                        PRIVATE