Skip to content

Commit

Permalink
Update module CMakeLists.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs committed Jan 22, 2024
1 parent e7a3ce0 commit cf491b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ macro(dissolve_add_module_gui modulename)
PRIVATE ${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/gui/gui_autogen/include
${CMAKE_BINARY_DIR}/src/gui/widgets/widgets_autogen/include
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
Expand Down Expand Up @@ -108,8 +109,13 @@ foreach(child ${children})
endif()
endforeach()

# Add each module subdirectory We need to construct a list of paths to any generated GUI ui_* files to pass to the moduleWidgetProducer
# target. It did not seem possible to construct a list to a global or CACHE variable from within the macro above, so here we just assume
# that every module has a relevant include directory.
set(MODULE_UI_INCLUDE_PATHS "")
foreach(subdir ${MODULE_DIRS})
add_subdirectory(${subdir})
list(APPEND MODULE_UI_INCLUDE_PATHS "${CMAKE_CURRENT_BINARY_DIR}/${subdir}/gui/module_${subdir}_gui_autogen/include")
endforeach()

add_library(moduleregistry registry.cpp registry.h)
Expand All @@ -133,6 +139,8 @@ if(GUI)
PRIVATE ${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src
${CMAKE_BINARY_DIR}/src/gui/gui_autogen/include
${CMAKE_BINARY_DIR}/src/gui/widgets/widgets_autogen/include
${MODULE_UI_INCLUDE_PATHS}
${Qt6Core_INCLUDE_DIRS}
${Qt6Gui_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
Expand Down

0 comments on commit cf491b5

Please sign in to comment.