Page MenuHomePhabricator

Classic C++ REST SDK superbuild integration
Closed, ResolvedPublic

Assigned To
Authored By
Feb 21 2019, 11:45 AM
Referenced Files
F1321270: cpprestsdk-targets-debug.cmake
Mar 4 2019, 9:06 AM
F1321268: cpprestsdk-targets.cmake
Mar 4 2019, 9:06 AM
F1321269: cpprestsdk-config.cmake
Mar 4 2019, 9:06 AM
F1321271: cpprestsdk-targets-release.cmake
Mar 4 2019, 9:06 AM


C++ REST SDK Dependencies

  • Boost: Check, we already have Boost.
  • WebSocket++: Integrated into C++ REST SDK as git submodule (git submodule update --init ...)
  • zlib: Already integrated in some projects like ITK, VTK, and Poco but all of them modify zlib so that it is not linkable anymore in a generic way. MITK_USE_ZLIB seems to be a relic and MITK code uses ITK's version of zlib. So we need to integrate pure up-to-date zlib as a dependency.

Event Timeline

kislinsk triaged this task as Wishlist priority.Feb 21 2019, 11:45 AM
kislinsk created this task.

Currently testing on Windows. Superbuild was successful.

Very nice!

I think at next, a run on linux would be good. Then we start testing it with Kim's branch, as it is the most recent cpp-rest version we want to have working.
What do you think?

Yes, Linux and macOS are next, but I currently have only access to a single computer, so it is a sequential process. :-)

Builds now on Linux and macOS. However, the cpprestsdk::cpprest tarket does not link against C++ REST SDK. Have to investigate further. Also, our superbuild does not recognize the dependency to ZLIB.

Fixed the dependencies to Boost and ZLIB. Changed the handling of zlib. The idea is, that it is not built if there is an easy to find system zlib. However, the decision is now made in the ZLIB script instead of the cpprestsdk script. Must be tested on Linux and macOS again, though.

@steint Can you please attach the following files from your vcpkg installation of C++ REST SDK?

  • cpprestsdk-config.cmake
  • cpprestsdk-targets.cmake
  • cpprestsdk-targets-debug.cmake
  • cpprestsdk-targets-release.cmake

Thank you!

Sure, here they are:

If I add cpprestsdk|cpprest to the PACKAGE_DEPENDS of a module, the properties of the cpprestsdk::cpprest target are not respected, i.e. the module is not linked against the library, leading to unresolved symbol linker errors. However, if I do it in plain CMake, it works:

  target_link_libraries(${MODULE_TARGET} PRIVATE cpprestsdk::cpprest)

I guess we have to look into the mitkFunctionCreateModule.cmake and mitkFunctionUseModules.cmake files and fix something related to "target namespaces".

I cannot build Boost while MITK_USE_cpprestsdk is ON.

1>------ Neues Erstellen gestartet: Projekt: ZERO_CHECK, Konfiguration: Release x64 ------
1>Checking Build System
1>CMake does not need to re-run because C:/dev/sao-plugin_bin/CMakeFiles/generate.stamp is up-to-date.
2>------ Neues Erstellen gestartet: Projekt: Boost, Konfiguration: Release x64 ------
2>Creating directories for 'Boost'
2>Building Custom Rule C:/dev/sao-plugin-src/CMakeLists.txt
2>CMake does not need to re-run because C:/dev/sao-plugin_bin/CMakeFiles/generate.stamp is up-to-date.
2>Performing pre_download step for 'Boost'
2>Files "extract-Boost.cmake" to "extract-Boost.replacement.cmake" are different.
2>-- Hooking into extract script
2>Performing download step (download, verify and extract) for 'Boost'
2>-- verifying file...
2>       file='C:/dev/sao-plugin_bin/ep/src/boost_1_68_0.7z'
2>-- File already exists and hash match (skip download):
2>  file='C:/dev/sao-plugin_bin/ep/src/boost_1_68_0.7z'
2>  MD5='ae25f29cdb82cf07e8e26187ddf7d330'
2>No update step for 'Boost'
2>Performing patch step for 'Boost'
2>patching file boost/iostreams/detail/config/fpos.hpp
2>Reversed (or previously applied) patch detected!  Skipping patch.
2>1 out of 1 hunk ignored -- saving rejects to file boost/iostreams/detail/config/fpos.hpp.rej
2>Performing bootstrap step for 'Boost'
2>Building Boost.Build engine
2>Der Befehl "cl" ist entweder falsch geschrieben oder
2>konnte nicht gefunden werden.
2>Failed to build Boost.Build engine.
2>Please consult bootstrap.log for further diagnostics.
2>Der Befehl "cmd" ist entweder falsch geschrieben oder
2>konnte nicht gefunden werden.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" wurde mit dem Code 1 beendet.
2>Die Erstellung des Projekts "Boost.vcxproj" ist abgeschlossen -- FEHLER.

bootstrap.log shows:

could not find "vswhere"
### Using 'vc141' toolset.

Okay, never mind. Now it works and i am not quite sure what i have done..
Maybe because i removed vcpkg from PATH.