diff --git a/CMakeModules/SimoxMacros.cmake b/CMakeModules/SimoxMacros.cmake
index 1c546ed9c9a9a8b769db88a5dc1d6cf708b18b5e..a4abbee7ac20ff5c11fde389471b2e5069134001 100644
--- a/CMakeModules/SimoxMacros.cmake
+++ b/CMakeModules/SimoxMacros.cmake
@@ -93,7 +93,13 @@ macro(_simox_generate_subdir_headers_impl dir prefix_to_remove out_headers)
         file(GLOB headers ${subdir}/*.h)
         list(LENGTH headers n)
         string(REGEX REPLACE ".*/" "" subdir_name "${subdir}")
-        if(NOT ${n} EQUAL 0 AND NOT "${subdir_name}" STREQUAL "detail")
+        if(
+                NOT ${n} EQUAL 0                          AND
+                NOT "${subdir_name}" STREQUAL "detail"    AND
+                NOT "${subdir_name}" STREQUAL "_detail"   AND
+                NOT "${subdir_name}" STREQUAL "internal"  AND
+                NOT "${subdir_name}" STREQUAL "_internal"
+        )
             set(subdir_header_abs "${subdir}.h")
             string(REPLACE "${prefix_to_remove}" "" subdir_header "${subdir_header_abs}")
             list(APPEND ${out_headers} ${subdir_header})