Closed nicolasbock closed 9 years ago
Interesting on the errors, my mac has cmake 3.0.1 and I get errors without the cmake_policy(SET CMP0042 NEW)
CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
CSPL
This warning is for project developers. Use -Wno-dev to suppress it.
We can try and do a version dependent check and set this for the new versions.
The set_target_properties( CSPL_Stats PROPERTIES POSITION_INDEPENDENT_CODE TRUE ) was the piece I did not get right, I tried this OBJECT way.
Sorry for the 1e6 posts. It was not the fPIC thing (macs don't need that, BSD compiler not GNU). I was chaining the add_subdirectory() commands between root and and CSPL to Stats.
As of CMake 2.8 one can build libraries using the OBJECT feature, so that several libraries can be combined into one using only the add_library() function. The POSITION_INDENPENDENT_CODE property needs to be set in case the user wants shared libraries (-DBUILD_SHARED_LIBS=yes).