Thanks Brad yes, and that's the point.
I've found my mistake, I had set the CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT between the check_cxx_source_compiles() calls and the add_subdirectory() calls. I moved the CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT initialization on top of the check_cxx_source_compiles() calls and everthing is working as expected. So, in my situation the order is: 1.) CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT 2.) check_cxx_source_compiles() and other platform checks 3.) add_subdirectory() and other stuff Best Regards Roman > -----Ursprüngliche Nachricht----- > Von: Brad King [mailto:brad.k...@kitware.com] > Gesendet: Dienstag, 28. Juli 2015 18:50 > An: Roman Wüger <roman.wue...@gmx.at> > Cc: CMake MailingList <cm...@cmake.org>; CMake Developer MailingList > <cmake-developers@cmake.org> > Betreff: Re: [cmake-developers] check_cxx_source_compiles and include > directories > > On 07/28/2015 12:23 PM, Roman Wüger wrote: > > I've tried it on Mac OS 10.10.4 with clang 6.1.0.6020053 from XCode 6 > > using "Unix Makefiles" as the generator. > > Is that using the Xcode Command Line Tools or the /usr/bin/c++ stub that > uses the /Applications/Xcode.app/.../bin/clang++ compiler underneath? > Is CMAKE_OSX_SYSROOT set? Does -isysroot appear on the compilation > command line? > > Thanks, > -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers