diff --git a/FullSimLight/CMakeLists.txt b/FullSimLight/CMakeLists.txt
index 067a352275d5bec6bf371924907a2a2f4ba8e93d..653a43da17f95762c78f98b9c9502a7172177e7a 100644
--- a/FullSimLight/CMakeLists.txt
+++ b/FullSimLight/CMakeLists.txt
@@ -19,8 +19,12 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
          "Framework finding behaviour on macOS" )
     # Set up how the project handle some of its dependenices. Either by picking them
     # up from the environment, or building them itself.
-    include( SetupJSON )
-    include( SetupXercesC )
+    if( NOT TARGET JSONExt )
+        include( SetupJSON )
+    endif()
+    if( NOT TARGET XercesCBuiltIn )
+        include( SetupXercesC )
+    endif()
     # Find the base GeoModel packages, which must be installed on the target system already
     find_package( GeoModelCore REQUIRED 4.0.0 ) #TODO: the version should be se in the root folder
     find_package( GeoModelIO REQUIRED 4.0.0 ) #TODO: the version should be se in the root folder
diff --git a/GeoModelVisualization/CMakeLists.txt b/GeoModelVisualization/CMakeLists.txt
index 52f5200f76f19a17f9e0d16c8b578737ef896c51..92888e94dcd323174c90fbd801fd5c8da58be830 100644
--- a/GeoModelVisualization/CMakeLists.txt
+++ b/GeoModelVisualization/CMakeLists.txt
@@ -19,9 +19,11 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
     include( configure_cpp_options )
     set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING
          "Framework finding behaviour on macOS" )
-    # Set up how the project handle some of its dependenices. Either by picking them
-    # up from the environment, or building them itself.
-    include( SetupJSON )
+    if( NOT TARGET JSONExt )
+        # Set up how the project handle some of its dependenices. Either by picking them
+        # up from the environment, or building them itself.
+        include( SetupJSON )
+    endif()
     # Find the base GeoModel packages, which must be installed on the target system already
     find_package( GeoModelCore REQUIRED 4.0.0 ) #TODO: the version should be se in the root folder
     find_package( GeoModelIO REQUIRED 4.0.0 ) #TODO: the version should be se in the root folder