From 5565a5875fc5abd4cfd6a143cc441835d3d12d06 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 22 Mar 2016 13:32:24 -0400 Subject: [PATCH] windows: implement packaging --- CMakeLists.txt | 5 + projects/win32/cmb.bundle.windows.cmake | 121 +++++++++++++++++++++++ projects/win32/hydrology.bundle.cmake | 2 + projects/win32/modelbuilder.bundle.cmake | 2 + 4 files changed, 130 insertions(+) create mode 100644 projects/win32/cmb.bundle.windows.cmake create mode 100644 projects/win32/hydrology.bundle.cmake create mode 100644 projects/win32/modelbuilder.bundle.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index cc3582e..9ec4e1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,11 @@ function (superbuild_add_packaging) TGZ) endif () + if (USE_SYSTEM_qt4) + list(APPEND superbuild_export_variables + QT_LIBRARY_DIR) + endif () + foreach (generator IN LISTS generators) superbuild_add_extra_package_test(modelbuilder "${generator}" LABELS "CMB" diff --git a/projects/win32/cmb.bundle.windows.cmake b/projects/win32/cmb.bundle.windows.cmake new file mode 100644 index 0000000..bac513f --- /dev/null +++ b/projects/win32/cmb.bundle.windows.cmake @@ -0,0 +1,121 @@ +set(CPACK_MONOLITHIC_INSTALL TRUE) + +# URL to website providing assistance in installing your application. +set(CPACK_NSIS_HELP_LINK "https://gitlab.kitware.com/cmb/cmb/wikis/home") + +#FIXME: need a pretty icon. +#set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_LIST_DIR}/paraview.ico") + +set(ModelBuilder_description "Model Builder") +set(paraview_description "ParaView") +set(pvserver_description "ParaView (server)") +set(pvdataserver_description "ParaView (data server)") +set(pvrenderserver_description "ParaView (render server)") +set(pvpython_description "ParaView (Python shell)") + +set(paraview_executables) +if (cmb_install_paraview_server) + set(paraview_executables + pvserver + pvdataserver + pvrenderserver + pvbatch + pvpython) +endif () + +set(library_paths "lib") + +if (USE_SYSTEM_qt4) + list(APPEND library_paths + "${QT_LIBRARY_DIR}") +endif () + +foreach (executable IN LISTS paraview_executables cmb_programs_to_install) + if (DEFINED "${executable}_description") + list(APPEND CPACK_NSIS_MENU_LINKS + "bin/${executable}.exe" "${${executable}_description}") + else () + message(WARNING "No description for ${executable} given.") + endif () + + superbuild_windows_install_program("${executable}" + "${library_paths}") +endforeach () + +foreach (plugin IN LISTS cmb_plugins_to_install) + superbuild_windows_install_plugin("${plugin}" + "${library_paths}") +endforeach () + +set(python_modules) +if (pythongirderclient_enabled) + list(APPEND python_modules + six + requests + girder_client) +endif () + +superbuild_windows_install_python( + "${CMAKE_INSTALL_PREFIX}" + MODULES smtk + shiboken + paraview + vtk + ${python_modules} + MODULE_DIRECTORIES + "${superbuild_install_location}/bin/Lib/site-packages" + "${superbuild_install_location}/lib/site-packages" + "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages" + SEARCH_DIRECTORIES + "lib") + +superbuild_windows_install_python( + "${CMAKE_INSTALL_PREFIX}" + MODULES vtk + MODULE_DIRECTORIES + "${superbuild_install_location}/bin/Lib/site-packages" + "${superbuild_install_location}/lib/site-packages" + "${superbuild_install_location}/lib/paraview-${paraview_version}/site-packages" + SEARCH_DIRECTORIES + "lib" + DESTINATION + "bin/Lib/site-packages/paraview") + +if (NOT USE_SYSTEM_python) + superbuild_windows_install_python( + "${CMAKE_INSTALL_PREFIX}" + MODULES ConfigParser StringIO UserDict __future__ _abcoll _weakrefset abc + atexit bisect code codecs codeop collections commands compileall + copy copy_reg difflib fnmatch functools genericpath getopt glob + hashlib functools heapq io keyword linecache locale new ntpath os + pickle pkgutil platform posixpath pprint py_compile random re runpy + shlex shutil site sre_compile sre_constants sre_parse stat string + struct subprocess sysconfig tempfile textwrap threading traceback + types warnings weakref + + ctypes distutils email encodings importlib json multiprocessing xml + MODULE_DIRECTORIES + "${superbuild_install_location}/bin/Lib" + SEARCH_DIRECTORIES + "lib" + DESTINATION + "bin/Lib") +endif () + +if (pythonrequests_enabled) + install( + FILES "${superbuild_install_location}/bin/Lib/site-packages/requests/cacert.pem" + DESTINATION "${cmb_package}/bin/Lib/site-packages/requests" + COMPONENT superbuild) +endif () + +# install the .plugins file +install( + FILES "${cmb_plugins_file}" + DESTINATION "bin" + COMPONENT superbuild) + +install( + DIRECTORY "${superbuild_install_location}/share/cmb/workflows/" + DESTINATION "share/cmb/workflows" + COMPONENT superbuild) diff --git a/projects/win32/hydrology.bundle.cmake b/projects/win32/hydrology.bundle.cmake new file mode 100644 index 0000000..12037b1 --- /dev/null +++ b/projects/win32/hydrology.bundle.cmake @@ -0,0 +1,2 @@ +include(hydrology.bundle.common) +include(cmb.bundle.windows) diff --git a/projects/win32/modelbuilder.bundle.cmake b/projects/win32/modelbuilder.bundle.cmake new file mode 100644 index 0000000..f2c2a66 --- /dev/null +++ b/projects/win32/modelbuilder.bundle.cmake @@ -0,0 +1,2 @@ +include(modelbuilder.bundle.common) +include(cmb.bundle.windows) -- GitLab