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:51:27 +0000 (17:51 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
tests/CMakeLists.txt

index 6c3aae9026b2b33709f2e3162dc093daa1d37443..37484614ccea4862da6157e2291b86d458a722a5 100644 (file)
@@ -7,6 +7,11 @@ include_directories(
   ${CMOCKA_INCLUDE_DIR}
 )
 
+# Required for cmocka >= 1.1.6
+if (TARGET cmocka::cmocka)
+    set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
 set(TORTURE_LIBRARY torture)
 
 # RFC862 echo server