From 4b12b115f92f9b8aa85984c7ad66593a61c487f9 2017-06-06 09:52:29 From: mperrinel Date: 2017-06-06 09:52:29 Subject: [PATCH] Merge branch 'feature/CpackForWindows' into develop --- diff --git a/SciQlopEnv.bat b/SciQlopEnv.bat index 4bb8587..cc1aa7c 100644 --- a/SciQlopEnv.bat +++ b/SciQlopEnv.bat @@ -3,6 +3,7 @@ echo Setting up environment for Qt usage... set QT_QMAKE_PATH=C:\Qt\5.8\mingw53_32\bin set QT_MINGW_PATH=C:\Qt\Tools\mingw530_32\bin +set NSIS_PATH=C:\Appli\NSIS set LLVM_PATH=C:\Appli\LLVM\bin set CMAKE_PATH=C:\Appli\CMake\bin set NINJA_PATH=C:\Appli\Ninja @@ -13,5 +14,5 @@ set PYTHON_PATH=C:\Appli\Python\Python36-32 set SCAN_BUILD_PATH=C:\Dev\CNRS-DEV\cfe\tools\scan-build\bin -set PATH=%QT_QMAKE_PATH%;%QT_MINGW_PATH%;%PERL_SITE_PATH%;%PERL_PATH%;%PYTHON_PATH%;%SCAN_BUILD_PATH%;%LLVM_PATH%;%CMAKE_PATH%;%NINJA_PATH%;%PATH% +set PATH=%QT_QMAKE_PATH%;%QT_MINGW_PATH%;%PERL_SITE_PATH%;%PERL_PATH%;%PYTHON_PATH%;%NSIS_PATH%;%SCAN_BUILD_PATH%;%LLVM_PATH%;%CMAKE_PATH%;%NINJA_PATH%;%PATH% cd /D C:\Dev\CNRS-DEV\SciQlopInit diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7b9f558..1076386 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,6 +1,7 @@ ## sciqlop - CMakeLists.txt SET(EXECUTABLE_NAME "sciqlop") +SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME) SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) diff --git a/cmake/sciqlop_applications.cmake b/cmake/sciqlop_applications.cmake index a9432bc..60f456c 100644 --- a/cmake/sciqlop_applications.cmake +++ b/cmake/sciqlop_applications.cmake @@ -3,19 +3,18 @@ # # Set ouptut directories # -SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) -SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) +SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist) +SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist) IF (UNIX) SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject) ELSEIF(WIN32) - SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}/app/QtProject) + SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/app/QtProject) ELSE() - SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) + SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist) ENDIF() -INCLUDE ("cmake/sciqlop_code_coverage.cmake") - if(BUILD_TESTS) + INCLUDE ("cmake/sciqlop_code_coverage.cmake") APPEND_COVERAGE_COMPILER_FLAGS() endif(BUILD_TESTS) diff --git a/cmake/sciqlop_package.cmake b/cmake/sciqlop_package.cmake index e69de29..8300aff 100644 --- a/cmake/sciqlop_package.cmake +++ b/cmake/sciqlop_package.cmake @@ -0,0 +1,60 @@ +# +# Generate the source package of SciqLop. +# + +install(DIRECTORY + ${EXECUTABLE_OUTPUT_PATH} + DESTINATION "." + USE_SOURCE_PERMISSIONS + COMPONENT CORE + PATTERN "*.a" EXCLUDE +) + +set(EXECUTABLEDOTEXTENSION) +if(WIN32) + set(EXECUTABLEDOTEXTENSION ".exe") +endif(WIN32) +set (SCIQLOP_EXE_LOCATION ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE_NAME}${EXECUTABLEDOTEXTENSION}) + +if(WIN32) + include ("cmake/sciqlop_package_qt.cmake") +endif(WIN32) + + +SET (CPACK_PACKAGE_VENDOR "CNRS") +SET (CPACK_PACKAGE_VERSION_MAJOR "${SCIQLOP_VERSION_MAJOR}") +SET (CPACK_PACKAGE_VERSION_MINOR "${SCIQLOP_VERSION_MINOR}") +SET (CPACK_PACKAGE_VERSION_PATCH "${SCIQLOP_VERSION_PATCH}${SCIQLOP_VERSION_SUFFIX}") +SET (CPACK_PACKAGE_VERSION "${SCIQLOP_VERSION}") +SET (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) +SET (CPACK_PACKAGE_CONTACT "nicolas.aunai@lpp.polytechnique.fr") +SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.md) +# SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_CURRENT_SOURCE_DIR}/WARN.txt) +SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +# SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME}-${PROJECT_VERSION}) +SET(FULLBUILD ON) + +SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +SET(CPACK_GENERATOR "NSIS") +SET(CPACK_MONOLITHIC_INSTALL 1) +#SET(CPACK_COMPONENTS_ALL sciqlop qt) +SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Setup") +SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_NAME}) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) +message("exepath" ${CPACK_PACKAGE_INSTALL_DIRECTORY}) + +if (WIN32) + SET(CPACK_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) + SET(CPACK_NSIS_COMPONENT_INSTALL ON) + SET(CPACK_SYSTEM_NAME "MinGW32") + SET(CPACK_PACKAGING_INSTALL_PREFIX "") + #SET(CPACK_GENERATOR "NSIS") + SET(CPACK_NSIS_DISPLAY_NAME ${PROJECT_NAME}) + SET(CPACK_NSIS_MUI_FINISHPAGE_RUN ${SCIQLOP_EXECUTABLE_NAME}) + SET(CPACK_NSIS_MUI_ICON ${SCIQLOP_EXECUTABLE_ICON_LOCATION}) + SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\${SCIQLOP_EXECUTABLE_NAME}.exe") +endif (WIN32) + +INCLUDE(CPack) diff --git a/core/include/Common/spimpl.h b/core/include/Common/spimpl.h index 7f6e8be..de37151 100644 --- a/core/include/Common/spimpl.h +++ b/core/include/Common/spimpl.h @@ -89,9 +89,8 @@ using default_copier_t = typename default_copier::type; template struct is_default_manageable - : public std::integral_constant >::value - && std::is_same >::value> { + : public std::integral_constant >::value + && std::is_same >::value> { }; } @@ -132,11 +131,10 @@ public: } template - impl_ptr(U *u, - typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT + impl_ptr(U *u, typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT : impl_ptr(u, &details::default_delete, &details::default_copy) { } @@ -153,12 +151,12 @@ public: #ifdef SPIMPL_HAS_AUTO_PTR template - impl_ptr(std::auto_ptr &&u, - typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete), - copier_(&details::default_copy) + impl_ptr(std::auto_ptr &&u, typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT + : ptr_(u.release(), &details::default_delete), + copier_(&details::default_copy) { } #endif @@ -240,9 +238,8 @@ public: #ifdef SPIMPL_HAS_AUTO_PTR template - typename std::enable_if::value - && is_default_manageable::value, - impl_ptr &>::type + typename std::enable_if< + std::is_convertible::value && is_default_manageable::value, impl_ptr &>::type operator=(std::auto_ptr &&u) SPIMPL_NOEXCEPT { return operator=(impl_ptr(std::move(u))); @@ -250,9 +247,8 @@ public: #endif template - typename std::enable_if::value - && is_default_manageable::value, - impl_ptr &>::type + typename std::enable_if< + std::is_convertible::value && is_default_manageable::value, impl_ptr &>::type operator=(std::unique_ptr &&u) SPIMPL_NOEXCEPT { return operator=(impl_ptr(std::move(u)));