diff --git a/CMakeLists.txt b/CMakeLists.txt index 122329cd00e..1dc3b2e07bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1) -project(Sofa) +project(Sofa VERSION 18.12.99) set(SOFA_KERNEL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SofaKernel" CACHE STRING "Path to SofaKernel") @@ -299,18 +299,86 @@ if(SOFA_INSTALL_RESOURCES_FILES) install(DIRECTORY examples/ DESTINATION share/sofa/examples COMPONENT resources) endif() -# CPack configuration -SET(CPACK_PACKAGE_VERSION_MAJOR "18") -SET(CPACK_PACKAGE_VERSION_MINOR "12") -SET(CPACK_PACKAGE_VERSION_PATCH "dev") -SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") + +####################### +# CPack configuration # +####################### + +################ +# Package config +include(CPackComponent) +include(CPackNSIS) +include(CPackIFW) +set(CPACK_PACKAGE_VERSION "${Sofa_VERSION}") set(CPACK_PACKAGE_NAME "SOFA v${CPACK_PACKAGE_VERSION}") -set(CPACK_PACKAGE_FILE_NAME "SOFA_v${CPACK_PACKAGE_VERSION}") set(CPACK_PACKAGE_VENDOR "The SOFA Team") -#set(CPACK_PACKAGE_CONTACT "contact@sofa-framework.org") -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_CONTACT "contact@sofa-framework.org") +set(CPACK_PACKAGE_DESCRIPTION "Real-time multi-physics simulation with an emphasis on medical simulation.") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Real-time multi-physics simulation with an emphasis on medical simulation.") set(CPACK_PACKAGE_EXECUTABLES "runSofa" "runSofa") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.sofa-framework.org") +set(CPACK_PACKAGE_FILE_NAME "SOFA_v${CPACK_PACKAGE_VERSION}") +if(WIN32) + set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/icons\\\\SOFA.png") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "SOFA\\\\v${CPACK_PACKAGE_VERSION}") + if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_Win64") + else() + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_Win32") + endif() +elseif(UNIX) + set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/icons/SOFA.png") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "SOFA/v${CPACK_PACKAGE_VERSION}") + if(APPLE) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_MacOS") + else() + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_Linux") + endif() +endif() +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.LGPL.txt") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README.md") +################ + +################## +# CPack components +cpack_add_component_group(runtime + DISPLAY_NAME "Runtime" + DESCRIPTION "Components needed to run a simulation with ${CPACK_PACKAGE_NAME}" + EXPANDED + ) +cpack_add_component_group(development + DISPLAY_NAME "Development" + DESCRIPTION "Components needed to write code based on ${CPACK_PACKAGE_NAME}" + EXPANDED + ) + +cpack_add_component(applications + DISPLAY_NAME "runSofa Application" + GROUP runtime + REQUIRED + ) +cpack_add_component(headers + DISPLAY_NAME "C++ Headers" + GROUP development + ) +cpack_add_component(Eigen_headers + DISPLAY_NAME "Eigen Headers" + GROUP development + ) +cpack_add_component(GTest_headers + DISPLAY_NAME "GTest Headers" + GROUP development + ) +cpack_add_component(libraries + DISPLAY_NAME "Libraries" + GROUP development + ) +cpack_add_component(resources + DISPLAY_NAME "Resources" + GROUP runtime + ) set(CPACK_COMPONENTS_ALL applications headers Eigen_headers GTest_headers libraries resources) @@ -327,35 +395,59 @@ set(CPACK_COMPONENT_EIGEN_HEADERS_GROUP "Development") set(CPACK_COMPONENT_GTEST_HEADERS_GROUP "Development") set(CPACK_COMPONENT_LIBRARIES_GROUP "Development") set(CPACK_COMPONENT_RESOURCES_GROUP "Runtime") - -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.LGPL.txt") -set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") -set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README.md") - +################## + +###################### +# IFW Generator config +set(CPACK_IFW_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") +set(CPACK_IFW_PACKAGE_TITLE "${CPACK_PACKAGE_NAME}") +set(CPACK_IFW_PRODUCT_URL "${CPACK_PACKAGE_HOMEPAGE_URL}") +set(CPACK_IFW_PACKAGE_LOGO "${CPACK_PACKAGE_ICON}") +set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CPACK_PACKAGE_INSTALL_DIRECTORY}") if(WIN32) - # There is a bug in NSI that does not handle full unix paths properly. Make - # sure there is at least one set of four (4) backlashes. - set(CPACK_PACKAGE_INSTALL_DIRECTORY "SOFA_v${CPACK_PACKAGE_VERSION}") - set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/icons\\\\SOFA.png") - set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\runSofa.exe") - set(CPACK_NSIS_DISPLAY_NAME "SOFA v${CPACK_PACKAGE_VERSION}") - set(CPACK_NSIS_HELP_LINK "https:\\\\\\\\www.sofa-framework.org") - set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\www.sofa-framework.org") - set(CPACK_NSIS_CONTACT "contact@sofa-framework.org") - set(CPACK_NSIS_INSTALL_ROOT "$PROFILE") + set(CPACK_IFW_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/applications/projects/runSofa/SOFA.ico") elseif(APPLE) - #set(CPACK_PACKAGE_INSTALL_DIRECTORY "SOFA/v${CPACK_PACKAGE_VERSION}") - - #set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/back.png") -else() - set(CPACK_PACKAGE_INSTALL_DIRECTORY "SOFA/v${CPACK_PACKAGE_VERSION}") + set(CPACK_IFW_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/applications/projects/runSofa/runSOFA.icns") endif() +cpack_ifw_configure_component_group(runtime + SORTING_PRIORITY 50 + DEFAULT TRUE + EXPANDED + FORCED_INSTALLATION + SCRIPT "${CMAKE_SOURCE_DIR}/scripts/qtifw/install.qs" + ) +cpack_ifw_configure_component_group(development + SORTING_PRIORITY 10 + DEFAULT TRUE + EXPANDED + ) +###################### + +####################### +# NSIS Generator config +# There is a bug in NSIS that does not handle full unix paths properly. Make +# sure there is at least one set of four (4) backslashes. +set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\runSofa.exe") +set(CPACK_NSIS_DISPLAY_NAME "SOFA v${CPACK_PACKAGE_VERSION}") +set(CPACK_NSIS_PACKAGE_NAME "SOFA v${CPACK_PACKAGE_VERSION}") +set(CPACK_NSIS_HELP_LINK "https:\\\\\\\\www.sofa-framework.org") +set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\www.sofa-framework.org") +set(CPACK_NSIS_MODIFY_PATH ON) +set(CPACK_NSIS_CONTACT "contact@sofa-framework.org") +set(CPACK_NSIS_INSTALL_ROOT "$PROFILE") +set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecShell \\\"open\\\" \\\"https://www.sofa-framework.org/thank-you?sofa=\\\${CPACK_PACKAGE_VERSION}&os=windows\\\"") +set(CPACK_NSIS_MENU_LINKS + "https://www.sofa-framework.org/documentation/" "SOFA User Documentation" + "https://www.sofa-framework.org/api/" "SOFA Developper API" + "https://www.sofa-framework.org/community/forum/" "SOFA Forum") +####################### + #dirty hack to pack component we want (named BundlePack from runSofa for example, and that will install .app + share) #if not set, it will install everything as usual #TODO: Redesign of a better architecture about bundling (runSofa ? libraries ? modeler ? other application ?) get_property(TEMP_CPACK_COMPONENTS_ALL GLOBAL PROPERTY RUNSOFA_CPACK_COMPONENTS_ALL ) -if(TEMP_CPACK_COMPONENTS_ALL) +if(APPLE AND TEMP_CPACK_COMPONENTS_ALL) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_ALL ${TEMP_CPACK_COMPONENTS_ALL}) endif() @@ -363,7 +455,7 @@ endif() option(SOFA_BUILD_RELEASE_PACKAGE "Run package specific configure" OFF) if(SOFA_BUILD_RELEASE_PACKAGE) message("Using package.cmake") - include( "package.cmake" ) + include("package.cmake") endif() -INCLUDE(CPack) +include(CPack) diff --git a/SofaKernel/SofaFramework/CMakeLists.txt b/SofaKernel/SofaFramework/CMakeLists.txt index 9e257a59992..235cace3122 100644 --- a/SofaKernel/SofaFramework/CMakeLists.txt +++ b/SofaKernel/SofaFramework/CMakeLists.txt @@ -185,9 +185,9 @@ install(FILES "${CMAKE_BINARY_DIR}/include/sofa/config.h" DESTINATION "include/s list(REMOVE_DUPLICATES SOFAFRAMEWORK_DEPENDENCY_INCLUDE_DIRECTORIES) ## Version -set(SOFAFRAMEWORK_VERSION "18.12.dev") -set(SOFA_VERSION "181299") -set(SOFA_VERSION_STR "\"${SOFAFRAMEWORK_VERSION}\"") +set(SOFAFRAMEWORK_VERSION "${Sofa_VERSION}") +set(SOFA_VERSION_STR "\"${Sofa_VERSION}\"") +set(SOFA_VERSION "${Sofa_VERSION_MAJOR}${Sofa_VERSION_MINOR}${Sofa_VERSION_PATCH}") configure_file(../framework/sofa/version.h.in "${CMAKE_BINARY_DIR}/include/sofa/version.h") install(FILES "${CMAKE_BINARY_DIR}/include/sofa/version.h" DESTINATION include/sofa COMPONENT headers) diff --git a/SofaKernel/SofaFramework/SofaMacros.cmake b/SofaKernel/SofaFramework/SofaMacros.cmake index 367d54595fd..c5222885929 100644 --- a/SofaKernel/SofaFramework/SofaMacros.cmake +++ b/SofaKernel/SofaFramework/SofaMacros.cmake @@ -395,27 +395,16 @@ endmacro() macro(sofa_install_libraries) foreach(library ${ARGN}) if(EXISTS ${library}) - get_filename_component(LIB_NAME ${library} NAME_WE) - get_filename_component(LIB_PATH ${library} PATH) - get_filename_component(LIBREAL ${library} REALPATH) get_filename_component(LIBREAL_NAME ${LIBREAL} NAME_WE) get_filename_component(LIBREAL_PATH ${LIBREAL} PATH) file(GLOB_RECURSE SHARED_LIBS - "${LIB_PATH}/${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}*" - "${LIB_PATH}/${LIB_NAME}[0-9]${CMAKE_SHARED_LIBRARY_SUFFIX}*" - "${LIB_PATH}/${LIB_NAME}[0-9][0-9]${CMAKE_SHARED_LIBRARY_SUFFIX}*" - "${LIBREAL_PATH}/${LIBREAL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}*" "${LIBREAL_PATH}/${LIBREAL_NAME}[0-9]${CMAKE_SHARED_LIBRARY_SUFFIX}*" "${LIBREAL_PATH}/${LIBREAL_NAME}[0-9][0-9]${CMAKE_SHARED_LIBRARY_SUFFIX}*" ) file(GLOB_RECURSE STATIC_LIBS - "${LIB_PATH}/${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}*" - "${LIB_PATH}/${LIB_NAME}[0-9]${CMAKE_STATIC_LIBRARY_SUFFIX}*" - "${LIB_PATH}/${LIB_NAME}[0-9][0-9]${CMAKE_STATIC_LIBRARY_SUFFIX}*" - "${LIBREAL_PATH}/${LIBREAL_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}*" "${LIBREAL_PATH}/${LIBREAL_NAME}[0-9]${CMAKE_STATIC_LIBRARY_SUFFIX}*" "${LIBREAL_PATH}/${LIBREAL_NAME}[0-9][0-9]${CMAKE_STATIC_LIBRARY_SUFFIX}*" diff --git a/applications/plugins/CImgPlugin/CMakeLists.txt b/applications/plugins/CImgPlugin/CMakeLists.txt index f6c7ff049e2..e830d467d86 100644 --- a/applications/plugins/CImgPlugin/CMakeLists.txt +++ b/applications/plugins/CImgPlugin/CMakeLists.txt @@ -1,10 +1,5 @@ -cmake_minimum_required(VERSION 2.8.12) -project(CImgPlugin) - - -set(${PROJECT_NAME}_MAJOR_VERSION 0) -set(${PROJECT_NAME}_MINOR_VERSION 1) -set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}) +cmake_minimum_required(VERSION 3.1) +project(CImgPlugin VERSION 0.1) set(HEADER_FILES ImageCImg.h diff --git a/applications/projects/runSofa/CMakeLists.txt b/applications/projects/runSofa/CMakeLists.txt index 95294de75fb..6b48c1b01ab 100644 --- a/applications/projects/runSofa/CMakeLists.txt +++ b/applications/projects/runSofa/CMakeLists.txt @@ -65,7 +65,7 @@ if(APPLE AND SOFA_BUILD_RELEASE_PACKAGE) find_package(CImgPlugin REQUIRED) find_package(SofaMiscCollision REQUIRED) find_package(SofaPython REQUIRED) - target_link_libraries(${PROJECT_NAME} SofaAllCommonComponents CImgPlugin SofaMiscCollision SofaPython) + target_link_libraries(${PROJECT_NAME} SofaAllCommonComponents CImgPlugin SofaMiscCollision SofaPython SofaSparseSolver SofaPreconditioner) set_property(GLOBAL PROPERTY RUNSOFA_CPACK_COMPONENTS_ALL BundlePack) include(cmake/bundle.cmake) else() diff --git a/applications/sofa/gui/qt/CMakeLists.txt b/applications/sofa/gui/qt/CMakeLists.txt index 6d5bb9677e6..064d44e2ac6 100644 --- a/applications/sofa/gui/qt/CMakeLists.txt +++ b/applications/sofa/gui/qt/CMakeLists.txt @@ -173,23 +173,37 @@ if(Qt5Core_FOUND) endif() sofa_install_libraries_from_targets(${QT_TARGETS}) - # QT INSTALL - get_target_property(QtCore_location Qt5::Core LOCATION_${CMAKE_BUILD_TYPE}) - string(REGEX MATCH "^.*/(bin|lib)/" QtCore_dir ${QtCore_location}) - string(REGEX REPLACE "/$" "" QtCore_dir "${QtCore_dir}") # remove trailing slash - # Installing Qt plugins the hard way (dirty) - install(DIRECTORY "${QtCore_dir}/../plugins/" DESTINATION "bin" COMPONENT applications) - # Installing Qt XCB libraries the hard way (dirty) + # QT INSTALL (dirty) + # Get Qt libraries dir + get_target_property(QtCore_location Qt5::Core LOCATION) + get_filename_component(QT_LIBRARIES_DIR ${QtCore_location} DIRECTORY) + message("QT_LIBRARIES_DIR = ${QT_LIBRARIES_DIR}") + # Get Qt plugins dir + list(GET Qt5Gui_PLUGINS 1 QT_PLUGIN_ANY) + if(TARGET ${QT_PLUGIN_ANY}) + get_target_property(QT_PLUGIN_ANY_LOCATION ${QT_PLUGIN_ANY} LOCATION) + get_filename_component(QT_PLUGINS_SUBDIR ${QT_PLUGIN_ANY_LOCATION} DIRECTORY) + get_filename_component(QT_PLUGINS_DIR ${QT_PLUGINS_SUBDIR} DIRECTORY) + else() + # Try to guess QT_PLUGINS_DIR + if(UNIX AND NOT APPLE AND EXISTS "${QT_LIBRARIES_DIR}/qt5/plugins") + set(QT_PLUGINS_DIR "${QT_LIBRARIES_DIR}/qt5/plugins") + endif() + endif() + message("QT_PLUGINS_DIR = ${QT_PLUGINS_DIR}") + # Install Qt plugins + install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION "bin" COMPONENT applications) + # Install Qt XCB libraries file(GLOB QT_XCB_LIBRARIES - "${QtCore_dir}/libQt5DBus${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libQt5XcbQpa${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libQt5DBus${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libQt5XcbQpa${CMAKE_SHARED_LIBRARY_SUFFIX}" ) sofa_install_libraries(${QT_XCB_LIBRARIES}) - # Installing Qt ICU libraries the hard way (dirty) + # Install Qt ICU libraries file(GLOB QT_ICU_LIBRARIES - "${QtCore_dir}/libicudata${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libicui18n${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libicuuc${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicudata${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicui18n${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicuuc${CMAKE_SHARED_LIBRARY_SUFFIX}" ) sofa_install_libraries(${QT_ICU_LIBRARIES}) endif() diff --git a/extlibs/libQGLViewer-2.7.1/QGLViewer/CMakeLists.txt b/extlibs/libQGLViewer-2.7.1/QGLViewer/CMakeLists.txt index 1ae6ab2dd11..d7656bdf1a1 100644 --- a/extlibs/libQGLViewer-2.7.1/QGLViewer/CMakeLists.txt +++ b/extlibs/libQGLViewer-2.7.1/QGLViewer/CMakeLists.txt @@ -63,23 +63,37 @@ if(Qt5Core_FOUND) endif() sofa_install_libraries_from_targets(${QT_TARGETS}) - # QT INSTALL - get_target_property(QtCore_location Qt5::Core LOCATION_${CMAKE_BUILD_TYPE}) - string(REGEX MATCH "^.*/(bin|lib)/" QtCore_dir ${QtCore_location}) - string(REGEX REPLACE "/$" "" QtCore_dir "${QtCore_dir}") # remove trailing slash - # Installing Qt plugins the hard way (dirty) - install(DIRECTORY "${QtCore_dir}/../plugins/" DESTINATION "bin" COMPONENT applications) - # Installing Qt XCB libraries the hard way (dirty) + # QT INSTALL (dirty) + # Get Qt libraries dir + get_target_property(QtCore_location Qt5::Core LOCATION) + get_filename_component(QT_LIBRARIES_DIR ${QtCore_location} DIRECTORY) + message("QT_LIBRARIES_DIR = ${QT_LIBRARIES_DIR}") + # Get Qt plugins dir + list(GET Qt5Gui_PLUGINS 1 QT_PLUGIN_ANY) + if(TARGET ${QT_PLUGIN_ANY}) + get_target_property(QT_PLUGIN_ANY_LOCATION ${QT_PLUGIN_ANY} LOCATION) + get_filename_component(QT_PLUGINS_SUBDIR ${QT_PLUGIN_ANY_LOCATION} DIRECTORY) + get_filename_component(QT_PLUGINS_DIR ${QT_PLUGINS_SUBDIR} DIRECTORY) + else() + # Try to guess QT_PLUGINS_DIR + if(UNIX AND NOT APPLE AND EXISTS "${QT_LIBRARIES_DIR}/qt5/plugins") + set(QT_PLUGINS_DIR "${QT_LIBRARIES_DIR}/qt5/plugins") + endif() + endif() + message("QT_PLUGINS_DIR = ${QT_PLUGINS_DIR}") + # Install Qt plugins + install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION "bin" COMPONENT applications) + # Install Qt XCB libraries file(GLOB QT_XCB_LIBRARIES - "${QtCore_dir}/libQt5DBus${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libQt5XcbQpa${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libQt5DBus${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libQt5XcbQpa${CMAKE_SHARED_LIBRARY_SUFFIX}" ) sofa_install_libraries(${QT_XCB_LIBRARIES}) - # Installing Qt ICU libraries the hard way (dirty) + # Install Qt ICU libraries file(GLOB QT_ICU_LIBRARIES - "${QtCore_dir}/libicudata${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libicui18n${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${QtCore_dir}/libicuuc${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicudata${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicui18n${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${QT_LIBRARIES_DIR}/libicuuc${CMAKE_SHARED_LIBRARY_SUFFIX}" ) sofa_install_libraries(${QT_ICU_LIBRARIES}) endif() diff --git a/package.cmake b/package.cmake index 8a4b99e0cd9..0ad314db503 100644 --- a/package.cmake +++ b/package.cmake @@ -31,20 +31,22 @@ setSofaOption(SOFA_USE_MASK OFF) setSofaOption(SOFA_BUILD_TESTS OFF) setSofaOption(SOFA_BUILD_TUTORIALS OFF) -# Set all plugins OFF +# Set all plugins/modules OFF get_cmake_property(_variableNames VARIABLES) list (SORT _variableNames) foreach (_variableName ${_variableNames}) - if(_variableName MATCHES "^PLUGIN_") + if(_variableName MATCHES "^PLUGIN_" OR _variableName MATCHES "^MODULE_") setSofaOption(${_variableName} OFF) endif() endforeach() -# Set some plugins ON +# Set some plugins/modules ON setSofaOption(PLUGIN_SOFAALLCOMMONCOMPONENTS ON) setSofaOption(PLUGIN_CIMGPLUGIN ON) setSofaOption(PLUGIN_SOFAPYTHON ON) setSofaOption(PLUGIN_SOFAMISCCOLLISION ON) +setSofaOption(MODULE_SOFASPARSESOLVER ON) +setSofaOption(MODULE_SOFAPRECONDITIONER ON) # Copy resources files (etc/, share/, examples/) when installing setSofaOption(SOFA_INSTALL_RESOURCES_FILES ON) diff --git a/scripts/qtifw/install.qs b/scripts/qtifw/install.qs new file mode 100644 index 00000000000..221454173ac --- /dev/null +++ b/scripts/qtifw/install.qs @@ -0,0 +1,26 @@ +function Component() +{ + // default constructor + + installer.finishButtonClicked.connect(this, Component.prototype.installationFinished); +} + +Component.prototype.createOperations = function() +{ + component.createOperations(); + + if (systemInfo.productType === "windows") { + component.addOperation("CreateShortcut", "@TargetDir@/bin/runSofa.exe", "@StartMenuDir@/runSofa.lnk", + "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/bin/runSofa.exe"); + + component.addOperation("CreateShortcut", "@TargetDir@/maintenancetool.exe", "@StartMenuDir@/Uninstall.lnk", + "workingDirectory=@TargetDir@", "iconPath=%SystemRoot%/system32/xwizard.exe"); + } +} + +Component.prototype.installationFinished = function() +{ + if (installer.isInstaller() && installer.status == QInstaller.Success) { + QDesktopServices.openUrl("https://www.sofa-framework.org/thank-you?sofa=" + installer.value("Version") + "&os=" + systemInfo.productType); + } +}