Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 109 lines (96 sloc) 3.273 kB
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
1 ################################################################################
2 #
3 # Program: 3D Slicer
4 #
05cbce1 @jcfr STYLE: Remove year from Kitware copyright
jcfr authored
5 # Copyright (c) Kitware Inc.
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
6 #
77b7beb @jcfr STYLE: Rename Doc/copyright/copyright.txt into COPYRIGHT.txt
jcfr authored
7 # See COPYRIGHT.txt
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
8 # or http://www.slicer.org/copyright/copyright.txt for details.
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 # This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17 # and was partially funded by NIH grant 3P41RR013218-12S1
18 #
19 ################################################################################
20
21 #
22 # SlicerMacroBuildModuleWidgets
23 #
24
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
25 macro(SlicerMacroBuildModuleWidgets)
fb88038 @jcfr COMP: Update system to use CMake built-in macro "cmake_parse_arguments"
jcfr authored
26 set(options
27 WRAP_PYTHONQT
28 NO_INSTALL
29 )
30 set(oneValueArgs
31 NAME
32 EXPORT_DIRECTIVE
94f1055 @jcfr ENH: Improve build targets organization in IDE that support folders
jcfr authored
33 FOLDER
fb88038 @jcfr COMP: Update system to use CMake built-in macro "cmake_parse_arguments"
jcfr authored
34 )
35 set(multiValueArgs
36 SRCS
37 MOC_SRCS
38 UI_SRCS
39 INCLUDE_DIRECTORIES
40 TARGET_LIBRARIES
41 RESOURCES
42 )
43 CMAKE_PARSE_ARGUMENTS(MODULEWIDGETS
44 "${options}"
45 "${oneValueArgs}"
46 "${multiValueArgs}"
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
47 ${ARGN}
48 )
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
49
5396bf7 @jcfr COMP: Unknown keyword passed to build macro now trigger an error.
jcfr authored
50 if(MODULEWIDGETS_UNPARSED_ARGUMENTS)
51 message(FATAL_ERROR "Unknown keywords given to SlicerMacroBuildModuleWidgets(): \"${MODULEWIDGETS_UNPARSED_ARGUMENTS}\"")
52 endif()
53
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
54 list(APPEND MODULEWIDGETS_INCLUDE_DIRECTORIES
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
55 ${Slicer_Libs_INCLUDE_DIRS}
56 ${Slicer_Base_INCLUDE_DIRS}
57 ${Slicer_ModuleLogic_INCLUDE_DIRS}
58 ${Slicer_ModuleMRML_INCLUDE_DIRS}
59 ${Slicer_ModuleWidgets_INCLUDE_DIRS}
60 )
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
61
62 list(APPEND MODULEWIDGETS_TARGET_LIBRARIES
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
63 ${Slicer_GUI_LIBRARY}
64 )
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
65
94f1055 @jcfr ENH: Improve build targets organization in IDE that support folders
jcfr authored
66 if(NOT DEFINED MODULEWIDGETS_FOLDER AND DEFINED MODULE_NAME)
67 set(MODULEWIDGETS_FOLDER "Module-${MODULE_NAME}")
68 endif()
69 if(NOT "${MODULEWIDGETS_FOLDER}" STREQUAL "")
70 set_target_properties(${lib_name} PROPERTIES FOLDER ${MODULEWIDGETS_FOLDER})
71 endif()
72
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
73 set(MODULEWIDGETS_WRAP_PYTHONQT_OPTION)
74 if(MODULEWIDGETS_WRAP_PYTHONQT)
75 set(MODULEWIDGETS_WRAP_PYTHONQT_OPTION "WRAP_PYTHONQT")
76 endif()
a03decf @jcfr ENH: SlicerMacroBuildModuleWidgets - Add NO_INSTALL option
jcfr authored
77 set(MODULEWIDGETS_NO_INSTALL_OPTION)
78 if(MODULEWIDGETS_NO_INSTALL)
79 set(MODULEWIDGETS_NO_INSTALL_OPTION "NO_INSTALL")
80 endif()
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
81
82 SlicerMacroBuildModuleQtLibrary(
83 NAME ${MODULEWIDGETS_NAME}
84 EXPORT_DIRECTIVE ${MODULEWIDGETS_EXPORT_DIRECTIVE}
94f1055 @jcfr ENH: Improve build targets organization in IDE that support folders
jcfr authored
85 FOLDER ${MODULEWIDGETS_FOLDER}
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
86 INCLUDE_DIRECTORIES ${MODULEWIDGETS_INCLUDE_DIRECTORIES}
87 SRCS ${MODULEWIDGETS_SRCS}
88 MOC_SRCS ${MODULEWIDGETS_MOC_SRCS}
89 UI_SRCS ${MODULEWIDGETS_UI_SRCS}
90 TARGET_LIBRARIES ${MODULEWIDGETS_TARGET_LIBRARIES}
91 RESOURCES ${MODULEWIDGETS_RESOURCES}
02541fe @jcfr ENH: Add "WRAP_PYTHONQT" option to SlicerMacroBuildModuleQtLibrary / …
jcfr authored
92 ${MODULEWIDGETS_WRAP_PYTHONQT_OPTION}
a03decf @jcfr ENH: SlicerMacroBuildModuleWidgets - Add NO_INSTALL option
jcfr authored
93 ${MODULEWIDGETS_NO_INSTALL_OPTION}
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
94 )
95
ee51fd4 @jcfr COMP: Configure include directories into SlicerConfig.cmake
jcfr authored
96 set_property(GLOBAL APPEND PROPERTY SLICER_MODULE_WIDGET_TARGETS ${MODULEWIDGETS_NAME})
97
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
98 #-----------------------------------------------------------------------------
99 # Update Slicer_ModuleWidgets_INCLUDE_DIRS
100 #-----------------------------------------------------------------------------
78cc2ee @jcfr COMP: Similarly to module located in Slicer source, extension should …
jcfr authored
101 set(Slicer_ModuleWidgets_INCLUDE_DIRS
102 ${Slicer_ModuleWidgets_INCLUDE_DIRS}
103 ${CMAKE_CURRENT_SOURCE_DIR}
104 ${CMAKE_CURRENT_BINARY_DIR}
6936c68 @jcfr COMP: Allow extension to update Slicer_Module*_INCLUDE_DIRS variables
jcfr authored
105 CACHE INTERNAL "Slicer Module widgets includes" FORCE)
73d5d9e @jcfr STYLE: Move CMake commands to match new conventions
jcfr authored
106
107 endmacro()
05a98f5 @jcfr COMP: Add SlicerMacroBuildModuleWidgets
jcfr authored
108
Something went wrong with that request. Please try again.