diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake
index 6c1b8eb559c5d7e4680a8dec478210ccbdb54754..5a8b2bcab00d66ead8daf3fd08e46aee3554ffb1 100644
--- a/cmake/CompilerOptions.cmake
+++ b/cmake/CompilerOptions.cmake
@@ -160,7 +160,7 @@ function(export_visibility target)
     # generate config file
     get_target_property(target_binary_dir ${target} BINARY_DIR)
     configure_file(
-        ${CMAKE_SOURCE_DIR}/cmake/export.hpp.in
+        ${PROJECT_SOURCE_DIR}/cmake/export.hpp.in
         ${target_binary_dir}/include/${target_short_name}/export.hpp
         @ONLY)
 endfunction()