CMake: Move build of crypto test suites to tf-psa-crypto

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21c9925..d20dbfe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -430,7 +430,6 @@
     enable_testing()
 
     add_subdirectory(tests)
-    add_subdirectory(tf-psa-crypto/tests)
 
     # additional convenience targets for Unix only
     if(UNIX)
diff --git a/tf-psa-crypto/CMakeLists.txt b/tf-psa-crypto/CMakeLists.txt
index 1dc9f9f..3669da3 100644
--- a/tf-psa-crypto/CMakeLists.txt
+++ b/tf-psa-crypto/CMakeLists.txt
@@ -38,3 +38,8 @@
 add_subdirectory(include)
 add_subdirectory(core)
 add_subdirectory(drivers)
+
+if(ENABLE_TESTING)
+    enable_testing()
+    add_subdirectory(tests)
+endif()
diff --git a/tf-psa-crypto/tests/CMakeLists.txt b/tf-psa-crypto/tests/CMakeLists.txt
index 88f12f8..cf25c71 100644
--- a/tf-psa-crypto/tests/CMakeLists.txt
+++ b/tf-psa-crypto/tests/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(libs
-    ${mbedtls_target}
+    ${mbedcrypto_target}
     ${CMAKE_THREAD_LIBS_INIT}
 )