Skip to content

Conversation

martinweismann
Copy link
Member

@martinweismann martinweismann commented May 2, 2018

This PR intends to resolve #58 .

Only BUILD_SHARED_LIBS is standard in CMAKE (BUILD_STATIC_LIBS is no standard cmake-option). CMake default is OFF.

This pull request changes the cmake-project structure such that only one version (static or shared library) of lib3MF is built:

  1. By default, the C-like interface is compiled into a shared library.
    (The reason to not include the C++-classes in the shared library is that this would decrease the portability of the shared library: bare C++ classes require matching runtime environments. It essentially puts all the restrictions a static library has into the shared library.)
  2. If BUILD_SHARED_LIBS=OFF, lib3MF's C-like interface and the underlying C++ classes will be available in the static library.
    Users of the static library can choose which interface to use.

Also adds the option BUILD_TESTING to determine whether the tests of the library should be built. Default is ON.

@martinweismann
Copy link
Member Author

martinweismann commented May 2, 2018

@t-paul : this should conform to "standard cmake" now. Can you check in your project and comment on it? Thanks!

@martinweismann martinweismann force-pushed the SpecifySharedBuild branch 2 times, most recently from 765c8ac to 9116b4a Compare May 4, 2018 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake configuration does not respect BUILD_SHARED_LIBS and BUILD_STATIC_LIBS
1 participant