diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 673017f0..28704461 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -528,18 +528,20 @@ foreach(dir ${LIBDIRS})
 endforeach(dir)
 
 # install libflatarray, too
-file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/*.hpp")
-foreach(i ${HEADERS})
-  install(FILES ${i} DESTINATION include/libflatarray)
-endforeach()
-file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/detail/*.hpp")
-foreach(i ${HEADERS})
-  install(FILES ${i} DESTINATION include/libflatarray/detail)
-endforeach()
-file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/testbed/*.hpp")
-foreach(i ${HEADERS})
-  install(FILES ${i} DESTINATION include/libflatarray/testbed)
-endforeach()
+if(NOT libflatarray_FOUND)
+  file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/*.hpp")
+  foreach(i ${HEADERS})
+    install(FILES ${i} DESTINATION include/libflatarray)
+  endforeach()
+  file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/detail/*.hpp")
+  foreach(i ${HEADERS})
+    install(FILES ${i} DESTINATION include/libflatarray/detail)
+  endforeach()
+  file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libflatarray/src/testbed/*.hpp")
+  foreach(i ${HEADERS})
+    install(FILES ${i} DESTINATION include/libflatarray/testbed)
+  endforeach()
+endif()
 
 # link against the libs we need
 set(INSTALLER_LINK_FLAGS "-L${CMAKE_INSTALL_PREFIX}/${LIB_DIR} -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/${LIB_DIR} -lgeodecomp ")
