diff --git a/Applications/CMakeLists.txt b/Applications/CMakeLists.txt
index 35289fb8dd5fbc3251e0ef3867d0b4773a9fb86e..c731e6e48d889da77ced75bd5908be439d3b576b 100644
--- a/Applications/CMakeLists.txt
+++ b/Applications/CMakeLists.txt
@@ -1,5 +1,3 @@
-include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
-
 add_subdirectory(ApplicationsLib)
 add_subdirectory(DataHolderLib)
 add_subdirectory(FileIO)
diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt
index b4f5777133ba0aeec9bf97e03349c47cb2ecda92..c5befdde247e52954875dc794092ba9c721aaf55 100644
--- a/Applications/FileIO/CMakeLists.txt
+++ b/Applications/FileIO/CMakeLists.txt
@@ -20,8 +20,6 @@ if(OGS_BUILD_SWMM)
     set(SOURCES ${SOURCES} ${SOURCES_SWMM})
 endif()
 
-include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
-
 # Create the library
 ogs_add_library(ApplicationsFileIO ${SOURCES})
 target_link_libraries(ApplicationsFileIO
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb3f02d8e0037efce7f4f00c3e061c696bdadc0b..c24add54443977f95b141831f821b24a5dc8ea14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,6 +172,12 @@ option(OGS_ENABLE_ELEMENT_CUBOID
        "Build FEM elements for cuboids (quads, hexahedra)." ON)
 option(OGS_ENABLE_ELEMENT_PRISM "Build FEM elements for prisms." ON)
 option(OGS_ENABLE_ELEMENT_PYRAMID "Build FEM elements for pyramids." ON)
+if(NOT OGS_MAX_ELEMENT_DIM MATCHES "^[0-3]$")
+  message(FATAL_ERROR "OGS_MAX_ELEMENT_DIM must be an integer between 0 and 3.")
+endif()
+if(NOT OGS_MAX_ELEMENT_ORDER MATCHES "^[0-9]$")
+  message(FATAL_ERROR "OGS_MAX_ELEMENT_ORDER must be an integer.")
+endif()
 
 option(OGS_CHECK_HEADER_COMPILATION "Check header for standalone compilation."
        OFF)
diff --git a/ProcessLib/BoundaryCondition/Python/CMakeLists.txt b/ProcessLib/BoundaryCondition/Python/CMakeLists.txt
index a1a184d68e52885dca2296a6d2a9c049a3ea844a..76659c100a78ff1cf0550f3fab5cdcf790f35e92 100644
--- a/ProcessLib/BoundaryCondition/Python/CMakeLists.txt
+++ b/ProcessLib/BoundaryCondition/Python/CMakeLists.txt
@@ -6,8 +6,17 @@ ogs_add_library(ProcessLibBoundaryConditionPython
             BHEInflowPythonBoundaryCondition.h
             BHEInflowPythonBoundaryConditionPythonSideInterface.h)
 
-target_compile_definitions(ProcessLibBoundaryConditionPython PUBLIC
-                           OGS_USE_PYTHON)
+target_compile_definitions(ProcessLibBoundaryConditionPython
+    PUBLIC
+    OGS_USE_PYTHON
+    # Enabled elements
+    OGS_MAX_ELEMENT_DIM=${OGS_MAX_ELEMENT_DIM}
+    OGS_MAX_ELEMENT_ORDER=${OGS_MAX_ELEMENT_ORDER}
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_SIMPLEX}>:OGS_ENABLE_ELEMENT_SIMPLEX>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_CUBOID}>:OGS_ENABLE_ELEMENT_CUBOID>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PRISM}>:OGS_ENABLE_ELEMENT_PRISM>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PYRAMID}>:OGS_ENABLE_ELEMENT_PYRAMID>
+)
 
 target_link_libraries(
     ProcessLibBoundaryConditionPython
diff --git a/ProcessLib/CMakeLists.txt b/ProcessLib/CMakeLists.txt
index 93661ce5292ad214eccfb6944fedd613fb8110a8..09ed1227c113f419e0d98bfcfd7c29c1c9ce1626 100644
--- a/ProcessLib/CMakeLists.txt
+++ b/ProcessLib/CMakeLists.txt
@@ -1,5 +1,3 @@
-include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
-
 # Collect the process libraries in interface library
 add_library(Processes INTERFACE)
 
@@ -49,3 +47,13 @@ target_link_libraries(ProcessLib
         spdlog::spdlog
         $<$<TARGET_EXISTS:InSituLib>:InSituLib>
 )
+
+target_compile_definitions(ProcessLib PUBLIC
+    # Enabled elements
+    OGS_MAX_ELEMENT_DIM=${OGS_MAX_ELEMENT_DIM}
+    OGS_MAX_ELEMENT_ORDER=${OGS_MAX_ELEMENT_ORDER}
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_SIMPLEX}>:OGS_ENABLE_ELEMENT_SIMPLEX>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_CUBOID}>:OGS_ENABLE_ELEMENT_CUBOID>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PRISM}>:OGS_ENABLE_ELEMENT_PRISM>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PYRAMID}>:OGS_ENABLE_ELEMENT_PYRAMID>
+)
diff --git a/ProcessLib/SourceTerms/Python/CMakeLists.txt b/ProcessLib/SourceTerms/Python/CMakeLists.txt
index 90cfd48520beb028400af4e550eb41bb8cb8eee5..d09465db096f63bcee18d66e0a0674b809fc5612 100644
--- a/ProcessLib/SourceTerms/Python/CMakeLists.txt
+++ b/ProcessLib/SourceTerms/Python/CMakeLists.txt
@@ -6,7 +6,17 @@ ogs_add_library(ProcessLibSourceTermPython
                 PythonSourceTermLocalAssembler.h
                 PythonSourceTermPythonSideInterface.h)
 
-target_compile_definitions(ProcessLibSourceTermPython PUBLIC OGS_USE_PYTHON)
+target_compile_definitions(ProcessLibSourceTermPython
+    PUBLIC
+    OGS_USE_PYTHON
+    # Enabled elements
+    OGS_MAX_ELEMENT_DIM=${OGS_MAX_ELEMENT_DIM}
+    OGS_MAX_ELEMENT_ORDER=${OGS_MAX_ELEMENT_ORDER}
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_SIMPLEX}>:OGS_ENABLE_ELEMENT_SIMPLEX>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_CUBOID}>:OGS_ENABLE_ELEMENT_CUBOID>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PRISM}>:OGS_ENABLE_ELEMENT_PRISM>
+    $<$<BOOL:${OGS_ENABLE_ELEMENT_PYRAMID}>:OGS_ENABLE_ELEMENT_PYRAMID>
+)
 
 target_link_libraries(
     ProcessLibSourceTermPython
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index c58be7155b6fdaec0c3f3aa8c036520a9e768b60..e6cd97ecd41d9fc4a11a08d86a627bca360a3645 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -4,7 +4,6 @@ if(OGS_USE_XDMF)
 endif()
 
 ### testrunner ###
-include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
 
 # VS2012 doesn't support correctly the tuples yet See
 # http://code.google.com/p/googletest/issues/detail?id=412
diff --git a/scripts/cmake/OGSEnabledElements.cmake b/scripts/cmake/OGSEnabledElements.cmake
deleted file mode 100644
index 1ece4402528288e785c95ee91eb49856e0e393cd..0000000000000000000000000000000000000000
--- a/scripts/cmake/OGSEnabledElements.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-# TODO: Move to process lib
-# Definitions controlling which FEM elements will be compiled
-if(NOT OGS_MAX_ELEMENT_DIM MATCHES "^[0-3]$")
-  message(FATAL_ERROR "OGS_MAX_ELEMENT_DIM must be an integer between 0 and 3.")
-endif()
-add_definitions(-DOGS_MAX_ELEMENT_DIM=${OGS_MAX_ELEMENT_DIM})
-
-if(NOT OGS_MAX_ELEMENT_ORDER MATCHES "^[0-9]$")
-  message(FATAL_ERROR "OGS_MAX_ELEMENT_ORDER must be an integer.")
-endif()
-add_definitions(-DOGS_MAX_ELEMENT_ORDER=${OGS_MAX_ELEMENT_ORDER})
-
-
-if(OGS_ENABLE_ELEMENT_SIMPLEX)
-    add_definitions(-DOGS_ENABLE_ELEMENT_SIMPLEX)
-endif()
-if(OGS_ENABLE_ELEMENT_CUBOID)
-    add_definitions(-DOGS_ENABLE_ELEMENT_CUBOID)
-endif()
-if(OGS_ENABLE_ELEMENT_PRISM)
-    add_definitions(-DOGS_ENABLE_ELEMENT_PRISM)
-endif()
-if(OGS_ENABLE_ELEMENT_PYRAMID)
-    add_definitions(-DOGS_ENABLE_ELEMENT_PYRAMID)
-endif()