diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ca566b3e5fa53f39d0dbcc11868a1e32e44c700..c5ab0308270e672b9d3929106a7a68fb73a8cc05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,8 +15,14 @@ if(NOT (${SUBMODULES_NO_BUILD} MATCHES ON))
             "-fpic"
         )
     endif()
+    if (NOT (TARGET dap_crypto))
+        add_subdirectory(libdap-crypto)
+        target_compile_options(
+            dap_crypto PRIVATE 
+            "-fpic"
+        )
+    endif()
 endif()
-add_subdirectory(libdap-crypto)
 
 file(GLOB CRYPTO_PYTHON_SRCS src/*.c)
 file(GLOB CRYPTO_PYTHON_HEADERS include/*.h)
@@ -29,16 +35,6 @@ add_library(${PROJECT_NAME} STATIC ${CRYPTO_PYTHON_SRCS} ${CRYPTO_PYTHON_HEADERS
 
 target_link_libraries(${PROJECT_NAME})
 
-target_compile_options(
-    dap_core PRIVATE 
-    "-fpic"
-)
-target_compile_options(
-    dap_crypto PRIVATE 
-    "-fpic"
-)
-
-
 target_link_libraries(${PROJECT_NAME} dap_core dap_crypto)
 
 target_include_directories(${PROJECT_NAME} PUBLIC include/ )