Skip to content

Commit

Permalink
Merge bb034d5 into dce3cd1
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Mar 28, 2019
2 parents dce3cd1 + bb034d5 commit 85c9d15
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 63 deletions.
26 changes: 8 additions & 18 deletions CMakeLists.txt
Expand Up @@ -59,9 +59,9 @@ elseif(APPLE)
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} can only be built using (Apple) Clang on macOS...")
endif()
else()
if( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5")
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} can only be built using GCC/G++ 5.x and later on Linux...")
if( NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"
AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(FATAL_ERROR "${CMAKE_PROJECT_NAME} can only be built using GCC/G++ on Linux...")
endif()
endif()

Expand Down Expand Up @@ -1171,7 +1171,7 @@ else()
else()
# Make sure that OpenCOR uses RPATH rather than RUNPATH

runpath2rpath(${PROJECT_NAME} ${PROJECT_BUILD_DIR}/bin/${CMAKE_PROJECT_NAME})
runpath2rpath(${PROJECT_NAME} ${PROJECT_BUILD_DIR}/${CMAKE_PROJECT_NAME})
endif()
endif()

Expand Down Expand Up @@ -1216,7 +1216,8 @@ if(WIN32)

# Install both the GUI and CLI versions of OpenCOR

install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin)
install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME
DESTINATION bin)
install(FILES ${PROJECT_BUILD_DIR}/bin/${CMAKE_PROJECT_NAME}.com
DESTINATION bin)

Expand Down Expand Up @@ -1318,19 +1319,8 @@ else()

# OpenCOR itself

install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin)

# Libraries needed on Ubuntu 16.04 LTS

foreach(LIBRARY app base interfaces pbutils reamer video)
set(FULL_LIBRARY ${CMAKE_SHARED_LIBRARY_PREFIX}gst${LIBRARY}-0.10${CMAKE_SHARED_LIBRARY_SUFFIX}.0)

get_filename_component(REAL_FULL_LIBRARY /usr/lib/x86_64-linux-gnu/${FULL_LIBRARY} REALPATH)

if(EXISTS ${REAL_FULL_LIBRARY})
linux_deploy_system_library(${REAL_FULL_LIBRARY} ${FULL_LIBRARY})
endif()
endforeach()
install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME
DESTINATION bin)

# Mesa library

Expand Down
52 changes: 27 additions & 25 deletions cmake/common.cmake
Expand Up @@ -86,6 +86,23 @@ endmacro()

#===============================================================================

macro(strip_file PROJECT_TARGET FILENAME)
# Strip the given file of all its local symbols
# Note: to strip QScintilla and Qwt when building them on Linux results in
# an error due to patchelf having been used on them. So, we use a
# wrapper that ignores errors and returns 0, so that our build doesn't
# break...

if("${PROJECT_TARGET}" STREQUAL "DIRECT")
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/scripts/strip -x ${FILENAME})
else()
add_custom_command(TARGET ${PROJECT_TARGET} POST_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/scripts/strip -x ${FILENAME})
endif()
endmacro()

#===============================================================================

macro(add_plugin PLUGIN_NAME)
# Various initialisations

Expand Down Expand Up @@ -251,12 +268,7 @@ macro(add_plugin PLUGIN_NAME)
# Strip the external library of all its local symbols, if possible

if(NOT WIN32 AND RELEASE_MODE)
if(${COPY_TARGET} STREQUAL "DIRECT")
execute_process(COMMAND strip -x ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
else()
add_custom_command(TARGET ${COPY_EXTERNAL_BINARIES_TARGET} POST_BUILD
COMMAND strip -x ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()
strip_file(${COPY_TARGET} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()

# Link the plugin to the external library
Expand All @@ -282,10 +294,10 @@ macro(add_plugin PLUGIN_NAME)
# and that it references the correct Qt libraries, if any at all

if(APPLE)
if(${COPY_TARGET} STREQUAL "DIRECT")
if("${COPY_TARGET}" STREQUAL "DIRECT")
execute_process(COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
else()
add_custom_command(TARGET ${COPY_EXTERNAL_BINARIES_TARGET} POST_BUILD
add_custom_command(TARGET ${COPY_TARGET} POST_BUILD
COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()

Expand Down Expand Up @@ -366,7 +378,7 @@ macro(add_plugin PLUGIN_NAME)
if(APPLE)
macos_clean_up_file_with_qt_dependencies(${PROJECT_NAME} ${DEST_PLUGINS_DIR} ${PLUGIN_FILENAME})
elseif(NOT WIN32)
runpath2rpath(${PROJECT_NAME} ${DEST_PLUGINS_DIR}/${PLUGIN_FILENAME})
runpath2rpath(${PROJECT_NAME} ${PLUGIN_BUILD_DIR}/${PLUGIN_FILENAME})
endif()

# Package the plugin, but only if we are not on macOS since it will have
Expand Down Expand Up @@ -659,12 +671,7 @@ macro(linux_deploy_qt_library PROJECT_TARGET DIRNAME FILENAME)
# Strip the Qt library of all its local symbols

if(RELEASE_MODE)
if("${PROJECT_TARGET}" STREQUAL "DIRECT")
execute_process(COMMAND strip -x ${PROJECT_BUILD_DIR}/lib/${FILENAME})
else()
add_custom_command(TARGET ${PROJECT_TARGET} POST_BUILD
COMMAND strip -x ${PROJECT_BUILD_DIR}/lib/${FILENAME})
endif()
strip_file(${PROJECT_TARGET} ${PROJECT_BUILD_DIR}/lib/${FILENAME})
endif()

# Deploy the Qt library
Expand Down Expand Up @@ -692,7 +699,7 @@ macro(linux_deploy_qt_plugin PLUGIN_CATEGORY)
# Strip the Qt plugin of all its local symbols

if(RELEASE_MODE)
execute_process(COMMAND strip -x ${PROJECT_BUILD_DIR}/${PLUGIN_DEST_DIRNAME}/${PLUGIN_FILENAME})
strip_file(DIRECT ${PROJECT_BUILD_DIR}/${PLUGIN_DEST_DIRNAME}/${PLUGIN_FILENAME})
endif()

# Deploy the Qt plugin
Expand Down Expand Up @@ -729,12 +736,7 @@ macro(macos_clean_up_file PROJECT_TARGET DIRNAME FILENAME)
set(FULL_FILENAME ${DIRNAME}/${FILENAME})

if(RELEASE_MODE)
if("${PROJECT_TARGET}" STREQUAL "DIRECT")
execute_process(COMMAND strip -x ${FULL_FILENAME})
else()
add_custom_command(TARGET ${PROJECT_TARGET} POST_BUILD
COMMAND strip -x ${FULL_FILENAME})
endif()
strip_file(${PROJECT_TARGET} ${FULL_FILENAME})
endif()

# Clean up the file's id
Expand Down Expand Up @@ -897,7 +899,7 @@ foreach(SHA1_FILE IN LISTS SHA1_FILES)
endif()
if(NOT WIN32 AND RELEASE_MODE)
execute_process(COMMAND strip -x \$\{REAL_SHA1_FILENAME\})
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/scripts/strip -x \$\{REAL_SHA1_FILENAME\})
endif()
file(SHA1 \$\{REAL_SHA1_FILENAME\} SHA1_VALUE)
Expand Down Expand Up @@ -1121,8 +1123,8 @@ macro(retrieve_package_file PACKAGE_NAME PACKAGE_VERSION DIRNAME SHA1_VALUE)
file(REMOVE ${FULL_COMPRESSED_FILENAME})
else()
file(REMOVE ${FULL_COMPRESSED_FILENAME})
# Note: this is in case we had an HTTP error of sorts, in which case
# we would end up with an empty file...
# Note: this is in case we had an HTTP/S error of sorts, in which
# case we would end up with an empty file...

message(FATAL_ERROR "The compressed version of the '${PACKAGE_NAME}' package could not be retrieved from '${PACKAGE_URL}'...")
endif()
Expand Down
2 changes: 1 addition & 1 deletion doc/downloads/index.js
Expand Up @@ -37,7 +37,7 @@ var jsonData = { "versions": [
}
],
"changes": [
{ "change": "<strong>General:</strong> now rely on <a href=\"https://visualstudio.microsoft.com/downloads/\">Visual Studio 2017 Update 9</a> to build OpenCOR on <a href=\"https://en.wikipedia.org/wiki/Microsoft_Windows\">Windows</a> (see issue <a href=\"https://github.com/opencor/opencor/issues/2041\">#2041</a>)." },
{ "change": "<strong>General:</strong> now rely on <a href=\"https://visualstudio.microsoft.com/downloads/\">Visual Studio 2017 Update 9</a> to build OpenCOR on <a href=\"https://en.wikipedia.org/wiki/Microsoft_Windows\">Windows</a> (see issue <a href=\"https://github.com/opencor/opencor/issues/2041\">#2041</a>). Upgraded our minimum requirement to <a href=\"https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_18.04_LTS_(Bionic_Beaver)\">Ubuntu 18.04 LTS</a> on Linux (see issue <a href=\"https://github.com/opencor/opencor/issues/2050\">#2050</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded <a href=\"http://www.llvm.org/\">LLVM</a>+<a href=\"http://clang.llvm.org/\">Clang</a> to version 8.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2040\">#2040</a>). Upgraded <a href=\"https://github.com/fbergmann/libSEDML/\">libSEDML</a> to version 0.4.4 (see issue <a href=\"https://github.com/opencor/opencor/issues/2042\">#2042</a>). Upgraded <a href=\"https://www.mesa3d.org/\">Mesa</a> to version 18.3.5 (see issue <a href=\"https://github.com/opencor/opencor/issues/2044\">#2044</a>)." }
]
},
Expand Down
2 changes: 1 addition & 1 deletion doc/supportedPlatforms.html
Expand Up @@ -41,7 +41,7 @@
<li><strong>OpenCOR 0.3 and 0.4.x:</strong> supported on both the 32-bit and 64-bit versions of <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_14.04_LTS_(Trusty_Tahr)">Ubuntu 14.04 LTS (Trusty Tahr)</a> and later.</li>
<li><strong>OpenCOR 0.5:</strong> supported on the 64-bit version of <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_14.04_LTS_(Trusty_Tahr)">Ubuntu 14.04 LTS (Trusty Tahr)</a> and later.</li>
<li><strong>OpenCOR 0.6:</strong> supported on the 64-bit version of <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_(Xenial_Xerus)">Ubuntu 16.04 LTS (Xenial Xerus)</a> and later.</li>
<li><strong>Snapshots:</strong> supported on the 64-bit version of <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_(Xenial_Xerus)">Ubuntu 16.04 LTS (Xenial Xerus)</a> and later.</li>
<li><strong>Snapshots:</strong> supported on the 64-bit version of <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_18.04_LTS_(Bionic_Beaver)">Ubuntu 18.04 LTS (Bionic Beaver)</a> and later.</li>
</ul>

<div class="section">
Expand Down
6 changes: 0 additions & 6 deletions doc/whatIsNew.js
Expand Up @@ -175,9 +175,6 @@ var jsonData = { "versions": [
"categories": [
{ "name": "General",
"entries": [
{ "type": "added", "description": "Support for <a href=\"https://en.wikipedia.org/wiki/Windows_10\">Windows 10</a>." },
{ "type": "added", "description": "Support for <a href=\"https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_16.04_LTS_.28Xenial_Xerus.29\">Ubuntu 16.04 LTS</a> (Xenial Xerus)." },
{ "type": "added", "description": "Support for <a href=\"https://en.wikipedia.org/wiki/OS_X_El_Capitan\">OS X 10.11</a> (El Capitan) and <a href=\"https://en.wikipedia.org/wiki/MacOS_Sierra\">macOS 10.12</a> (Sierra)." },
{ "type": "added", "description": "Resetting all your settings from the <a href=\"https://en.wikipedia.org/wiki/Command-line_interface\">CLI</a>." },
{ "type": "added", "description": "Detection of changes to one or several file dependencies." },
{ "type": "added", "description": "Support for an OpenCOR-specific URL scheme." },
Expand Down Expand Up @@ -346,8 +343,6 @@ var jsonData = { "versions": [
"entries": [
{ "type": "added", "description": "Checking for updates." },
{ "type": "added", "description": "<a href=\"howToGetStarted.html\">How to get started</a> section." },
{ "type": "added", "description": "Support for 64-bit <a href=\"https://en.wikipedia.org/wiki/Microsoft_Windows\">Windows</a>." },
{ "type": "added", "description": "Support for <a href=\"https://en.wikipedia.org/wiki/OS_X_Yosemite\">OS X 10.10</a> (Yosemite)." },
{ "type": "improved", "description": "OpenCOR logo." },
{ "type": "improved", "description": "Binaries on <a href=\"https://en.wikipedia.org/wiki/OS_X\">OS X</a>." },
{ "type": "improved", "description": "<a href=\"https://nsis.sourceforge.io/\">NSIS</a> packaging on <a href=\"https://en.wikipedia.org/wiki/Microsoft_Windows\">Windows</a>." },
Expand Down Expand Up @@ -556,7 +551,6 @@ var jsonData = { "versions": [
{ "name": "General",
"entries": [
{ "type": "added", "description": "<a href=\"licensing.html\">Open source license</a>." },
{ "type": "added", "description": "Support for <a href=\"https://en.wikipedia.org/wiki/Mac_OS_X_Lion\">Mac OS X 10.7</a> (Lion) and later." },
{ "type": "added", "description": "Showing/hiding of all the recent/current docked widgets at once." },
{ "type": "added", "description": "<a href=\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1359535/\">Noble 1962</a> as one of the <a href=\"https://www.cellml.org/\">CellML</a> file examples." },
{ "type": "added", "description": "Reloading of a file." },
Expand Down
5 changes: 5 additions & 0 deletions scripts/strip
@@ -0,0 +1,5 @@
#!/bin/sh

strip "$@" 2> /dev/null

exit 0
21 changes: 16 additions & 5 deletions src/plugins/thirdParty/QScintilla/CMakeLists.txt
Expand Up @@ -83,9 +83,9 @@ if(USE_PREBUILT_QSCINTILLA_PACKAGE)
SHA1_VALUES 52dbf010e21045a04112d066fc2abb0ba21bc34c)
else()
retrieve_package_file(${PACKAGE_NAME} ${PACKAGE_VERSION}
${RELATIVE_PROJECT_SOURCE_DIR} 6a64ba6d94568da2aad1318c31a175d6633ac38c
${RELATIVE_PROJECT_SOURCE_DIR} 088a41487146864415c38d5cf48558a94d4ed0af
SHA1_FILES ${SHA1_FILES}
SHA1_VALUES 79d52722c953cb337081ebeae481e74d7dc0e9df)
SHA1_VALUES 6ec3695e71aeeb26dca6f7bbd6c575fa5b84bc05)
endif()
else()
# Set platform specific configuration options
Expand Down Expand Up @@ -136,14 +136,25 @@ else()
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES install)

if(APPLE)
# Fix the RPATH information
# Fix the RPATH information

if(APPLE)
ExternalProject_Add_Step(${PACKAGE_BUILD} fixRpath
COMMAND install_name_tool -add_rpath @executable_path/../Frameworks ${SHARED_LIBRARY}
COMMAND install_name_tool -delete_rpath ${QT_LIBRARY_DIR} ${SHARED_LIBRARY}
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES copyLibrary)
else()
# Note: we wouldn't normally strip the library here since it's done
# elsewhere in our build process, but it happens that there is
# an issue with the system version of patchelf that prevents
# the library from being stripped afterwards...

ExternalProject_Add_Step(${PACKAGE_BUILD} fixRpath
COMMAND strip -x ${SHARED_LIBRARY}
COMMAND patchelf --remove-rpath ${SHARED_LIBRARY}
COMMAND patchelf --set-rpath $ORIGIN --force-rpath ${SHARED_LIBRARY}
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES copyLibrary)
endif()
endif()

Expand Down
27 changes: 20 additions & 7 deletions src/plugins/thirdParty/Qwt/CMakeLists.txt
Expand Up @@ -97,10 +97,10 @@ if(USE_PREBUILT_QWT_PACKAGE)
95fb741efee4869580381ba2937ecd0844dbb690)
else()
retrieve_package_file(${PACKAGE_NAME} ${PACKAGE_VERSION}
${RELATIVE_PROJECT_SOURCE_DIR} 381b0959620e75bbbba71a566f65edb7c72ab6fd
${RELATIVE_PROJECT_SOURCE_DIR} 73e893669bb0e2cf334fcedc77dd1da70ad10f18
SHA1_FILES ${SHA1_FILES}
SHA1_VALUES 0bbc21646c80c63d37da95e5f6da131608f18649
20942273668742335d5ab5f754a26148ee331162)
SHA1_VALUES 80ab718f8ad589a520d17c697205574cfa5c7dc1
b1194973180ae987f03b3d6fc639af736f4104a4)
endif()
else()
# Set platform specific configuration options
Expand Down Expand Up @@ -157,19 +157,32 @@ else()
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES install)

if(APPLE)
# Fix the RPATH information
# Fix the RPATH information

if(APPLE)
ExternalProject_Add_Step(${PACKAGE_BUILD} fixRpath
COMMAND install_name_tool -add_rpath @executable_path/../Frameworks ${QWT_SHARED_LIBRARY}
COMMAND install_name_tool -delete_rpath ${QT_LIBRARY_DIR} ${QWT_SHARED_LIBRARY}
COMMAND install_name_tool -add_rpath @executable_path/../Frameworks ${QWTMATHML_SHARED_LIBRARY}
COMMAND install_name_tool -delete_rpath ${QT_LIBRARY_DIR} ${QWTMATHML_SHARED_LIBRARY}
COMMAND install_name_tool -change ${QWT_SHARED_LIBRARY}
@rpath/${QWT_SHARED_LIBRARY}
${QWTMATHML_SHARED_LIBRARY}
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES copyQwtmathmlLibrary)
else()
# Note: we wouldn't normally strip the library here since it's done
# elsewhere in our build process, but it happens that there is
# an issue with the system version of patchelf that prevents
# the library from being stripped afterwards...

ExternalProject_Add_Step(${PACKAGE_BUILD} fixRpath
COMMAND strip -x ${QWT_SHARED_LIBRARY}
COMMAND patchelf --remove-rpath ${QWT_SHARED_LIBRARY}
COMMAND patchelf --set-rpath $ORIGIN --force-rpath ${QWT_SHARED_LIBRARY}
COMMAND strip -x ${QWTMATHML_SHARED_LIBRARY}
COMMAND patchelf --remove-rpath ${QWTMATHML_SHARED_LIBRARY}
COMMAND patchelf --set-rpath $ORIGIN --force-rpath ${QWTMATHML_SHARED_LIBRARY}
WORKING_DIRECTORY ${EXTERNAL_BINARIES_DIR}
DEPENDEES copyQwtmathmlLibrary)
endif()
endif()

Expand Down

0 comments on commit 85c9d15

Please sign in to comment.