Commit 05a98f58 authored by jcfr's avatar jcfr

COMP: Add SlicerMacroBuildModuleWidgets

This macro uses the more generic macro SlicerMacroBuildModuleQtLibrary
and update the variable Slicer_ModuleWidgets_INCLUDE_DIRS.
This variable is configured into SlicerConfig and can be re-used within
loadable extension.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@16723 3bd1e089-480b-0410-8dfb-8563597acbee
parent b7c9eca6
......@@ -50,10 +50,6 @@ MACRO(SlicerMacroBuildModuleQtLibrary)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${Slicer_Libs_INCLUDE_DIRS}
${Slicer_Base_INCLUDE_DIRS}
${Slicer_ModuleLogic_INCLUDE_DIRS}
${Slicer_ModuleMRML_INCLUDE_DIRS}
${MODULEQTLIBRARY_INCLUDE_DIRECTORIES}
)
......@@ -131,7 +127,6 @@ MACRO(SlicerMacroBuildModuleQtLibrary)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES LABELS ${lib_name})
TARGET_LINK_LIBRARIES(${lib_name}
${Slicer_GUI_LIBRARY}
${MODULEQTLIBRARY_TARGET_LIBRARIES}
)
......
################################################################################
#
# Program: 3D Slicer
#
# Copyright (c) 2010 Kitware Inc.
#
# See Doc/copyright/copyright.txt
# or http://www.slicer.org/copyright/copyright.txt for details.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
# and was partially funded by NIH grant 3P41RR013218-12S1
#
################################################################################
#
# SlicerMacroBuildModuleWidgets
#
MACRO(SlicerMacroBuildModuleWidgets)
SLICER_PARSE_ARGUMENTS(MODULEWIDGETS
"NAME;EXPORT_DIRECTIVE;SRCS;MOC_SRCS;UI_SRCS;INCLUDE_DIRECTORIES;TARGET_LIBRARIES;RESOURCES"
""
${ARGN}
)
LIST(APPEND MODULEWIDGETS_INCLUDE_DIRECTORIES
${Slicer_Libs_INCLUDE_DIRS}
${Slicer_Base_INCLUDE_DIRS}
${Slicer_ModuleLogic_INCLUDE_DIRS}
${Slicer_ModuleMRML_INCLUDE_DIRS}
${Slicer_ModuleWidgets_INCLUDE_DIRS}
)
LIST(APPEND MODULEWIDGETS_TARGET_LIBRARIES
${Slicer_GUI_LIBRARY}
)
SlicerMacroBuildModuleQtLibrary(
NAME ${MODULEWIDGETS_NAME}
EXPORT_DIRECTIVE ${MODULEWIDGETS_EXPORT_DIRECTIVE}
INCLUDE_DIRECTORIES ${MODULEWIDGETS_INCLUDE_DIRECTORIES}
SRCS ${MODULEWIDGETS_SRCS}
MOC_SRCS ${MODULEWIDGETS_MOC_SRCS}
UI_SRCS ${MODULEWIDGETS_UI_SRCS}
TARGET_LIBRARIES ${MODULEWIDGETS_TARGET_LIBRARIES}
RESOURCES ${MODULEWIDGETS_RESOURCES}
)
#-----------------------------------------------------------------------------
# Update Slicer_ModuleWidgets_INCLUDE_DIRS
#-----------------------------------------------------------------------------
IF(Slicer_SOURCE_DIR)
SET(Slicer_ModuleWidgets_INCLUDE_DIRS
${Slicer_ModuleWidgets_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
CACHE INTERNAL "Slicer Module Widgets includes" FORCE)
ENDIF()
ENDMACRO()
......@@ -267,7 +267,8 @@ ENDIF()
SET(Slicer_Base_LIBRARIES CACHE INTERNAL "Slicer Base libraries" FORCE)
SET(Slicer_Base_INCLUDE_DIRS CACHE INTERNAL "Slicer Base includes" FORCE)
SET(Slicer_ModuleLogic_INCLUDE_DIRS CACHE INTERNAL "Slicer Module logic includes" FORCE)
SET(Slicer_ModuleMRML_INCLUDE_DIRS CACHE INTERNAL "Slicer Module logic includes" FORCE)
SET(Slicer_ModuleMRML_INCLUDE_DIRS CACHE INTERNAL "Slicer Module MRML includes" FORCE)
SET(Slicer_ModuleWidgets_INCLUDE_DIRS CACHE INTERNAL "Slicer Module Widgets includes" FORCE)
#-----------------------------------------------------------------------------
# Get sytem name and architecture
......@@ -518,13 +519,14 @@ ADD_SUBDIRECTORY(Base)
ADD_SUBDIRECTORY(Resources)
#-----------------------------------------------------------------------------
# Macro useful to build ModuleLogic and ModuleMRML libraries
# Macro useful to build ModuleLogic, ModuleMRML and ModuleWidgets libraries
#-----------------------------------------------------------------------------
INCLUDE(SlicerMacroBuildModuleQtLibrary)
INCLUDE(SlicerMacroBuildModuleVTKLibrary)
INCLUDE(SlicerMacroPythonWrapModuleVTKLibrary)
INCLUDE(SlicerMacroBuildModuleLogic)
INCLUDE(SlicerMacroBuildModuleMRML)
INCLUDE(SlicerMacroBuildModuleWidgets)
#-----------------------------------------------------------------------------
# Slicer Core and GUI library
......
PROJECT(qSlicer${qt_module_name}ModuleWidgets)
#
# See CMake/SlicerMacroBuildModuleQtLibrary.cmake for details
# See CMake/SlicerMacroBuildModuleWidgets.cmake for details
#
SET(module_widgets_name "${PROJECT_NAME}")
......@@ -38,7 +38,7 @@ SET(module_widgets_target_libraries
vtkSlicerAnnotationModuleMRML
)
SlicerMacroBuildModuleQtLibrary(
SlicerMacroBuildModuleWidgets(
NAME ${module_widgets_name}
EXPORT_DIRECTIVE ${module_widgets_export_directive}
INCLUDE_DIRECTORIES ${module_widgets_include_directories}
......
......@@ -123,6 +123,9 @@ set(Slicer_ModuleLogic_INCLUDE_DIRS "@Slicer_ModuleLogic_INCLUDE_DIRS_CONFIG@")
# Slicer Module MRML include file directories.
set(Slicer_ModuleMRML_INCLUDE_DIRS "@Slicer_ModuleMRML_INCLUDE_DIRS_CONFIG@")
# Slicer Module Widgets include file directories.
set(Slicer_ModuleWidgets_INCLUDE_DIRS "@Slicer_ModuleWidgets_INCLUDE_DIRS_CONFIG@")
# The location of the UseSlicer.cmake file.
set(Slicer_USE_FILE "@Slicer_USE_FILE_CONFIG@")
......
......@@ -34,6 +34,7 @@ SET(Slicer_Libs_INCLUDE_DIRS_CONFIG ${Slicer_Libs_INCLUDE_DIRS})
SET(Slicer_Base_INCLUDE_DIRS_CONFIG ${Slicer_Base_INCLUDE_DIRS})
SET(Slicer_ModuleLogic_INCLUDE_DIRS_CONFIG ${Slicer_ModuleLogic_INCLUDE_DIRS})
SET(Slicer_ModuleMRML_INCLUDE_DIRS_CONFIG ${Slicer_ModuleMRML_INCLUDE_DIRS})
SET(Slicer_ModuleWidgets_INCLUDE_DIRS_CONFIG ${Slicer_ModuleWidgets_INCLUDE_DIRS})
# Qt
SET(QT_QMAKE_EXECUTABLE_CONFIG ${QT_QMAKE_EXECUTABLE})
......
......@@ -65,6 +65,7 @@ include(SlicerMacroBuildModuleVTKLibrary)
#include(SlicerMacroPythonWrapModuleVTKLibrary)
include(SlicerMacroBuildModuleLogic)
include(SlicerMacroBuildModuleMRML)
include(SlicerMacroBuildModuleWidgets)
include(SlicerMacroBuildQtModule)
#-----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment