diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a662ca7ab334ceee62ae746387df947e007233e..fea40651dda48640dd89aa77dad198b77bd337b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION 3.0)
-
+if(TARGET dap_test)
+    return() # The project has already been built.
+endif()
 project(dap_test)
 
 add_library(${PROJECT_NAME} STATIC dap_test.h dap_test.c)