diff --git a/CMakeLists.txt b/CMakeLists.txt index f9a44a6b84c..03e6753cfb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -400,8 +400,8 @@ if(MSVC) set(${flag} "${${flag}} /wd4996") # The POSIX name for this item is deprecated. endforeach() -# this flag causes MSVC to correctly report __cplusplus, which prevents a compiler error -# caused by some versions of libsndfile's C++ header redefining nullptr as NULL. +# this flag causes MSVC to correctly report __cplusplus, which prevents a compiler error +# caused by some versions of libsndfile's C++ header redefining nullptr as NULL. # See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ add_compile_options("/Zc:__cplusplus") @@ -578,20 +578,43 @@ endif() install(FILES ${AdditionalInstallFiles} DESTINATION ${auxresourcesdir}) if(INSTALL_HELP) - if(SC_SYMLINK_CLASSLIB AND APPLE) - message(STATUS "Will create symlink of HelpSource to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource") - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource") - message(FATAL_ERROR "Symlinking will fail ! HelpSource folder already exists, please delete it first." ) - endif() - install( CODE - "EXECUTE_PROCESS(COMMAND ln -shF ${CMAKE_CURRENT_SOURCE_DIR}/HelpSource ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource )" ) - elseif(NOT APPLE) - install(DIRECTORY HelpSource - DESTINATION ${auxresourcesdir} - PATTERN "*~" EXCLUDE - PATTERN "*#" EXCLUDE - ) - endif() + if(SC_SYMLINK_CLASSLIB AND APPLE) + message(STATUS "Will create symlink of HelpSource to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource") + message(FATAL_ERROR "Symlinking will fail! HelpSource folder already exists, please delete it first.") + endif() + install(CODE + "EXECUTE_PROCESS(COMMAND ln -shF ${CMAKE_CURRENT_SOURCE_DIR}/HelpSource ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource)") + elseif(NOT APPLE) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + # Check if the system is based on Debian + execute_process( + COMMAND cat /proc/version + OUTPUT_VARIABLE SYSTEM_VERSION_INFO + ) + # If the system is Debian, exclude the HelpSource/lib/MathLab folder + if("${SYSTEM_VERSION_INFO}" MATCHES "debian") + install(DIRECTORY HelpSource + DESTINATION ${auxresourcesdir} + PATTERN "HelpSource/lib/node_modules/*" EXCLUDE + PATTERN "*~" EXCLUDE + PATTERN "*#" EXCLUDE + ) + else() + install(DIRECTORY HelpSource + DESTINATION ${auxresourcesdir} + PATTERN "*~" EXCLUDE + PATTERN "*#" EXCLUDE + ) + endif() + else() + install(DIRECTORY HelpSource + DESTINATION ${auxresourcesdir} + PATTERN "*~" EXCLUDE + PATTERN "*#" EXCLUDE + ) + endif() + endif() endif()