[Insight-developers] Adding -std= and -stdlib= to ITK_REQUIRED_CXX_FLAGS

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Feb 6 08:55:35 EST 2014


Hello,

I have been trying to resolve some issue with SimpleITK and libc++ with XCode 5.0 and clang 5.0. My current solution to to compile ITK with the default flags but add "-std=c++11" to compile SimpleITK as needed. This combination tests well and seems to integrate OK into Slicer3D.

Related to this is how the "-stdlib=" and "-std=" compiler flags can change features in the compiler and try_compiles can be dependent on them. So in many ways if ITK is compiled with these flags they should be propagated to the projects using ITK, which is what the ITK_REQUIRED_CXX_FLAGS is for. Here is what I coded in SimpleITK to do what I am suggesting:

https://github.com/SimpleITK/SimpleITK/blob/next/CMake/sitkCheckRequiredFlags.cmake#L13-L31

Any suggestion or experience to share on these two issue?

Thanks,
Brad


More information about the Insight-developers mailing list