Hi,

I was struggling with a compilation of a project via CMake. Thu build
kept failing for unknown reasons until I realized that CMake would
automatically compile with

    -isysroot /Developer/SDKs/MacOSX10.6.sdk \
    -mmacosx-version-min=10.6

(or any other sdk, depending on OS version) unless instructed *NOT* to
do so by specifying:

   -DCMAKE_OSX_SYSROOT="/"
   -DCMAKE_OSX_DEPLOYMENT_TARGET=""

I had extra problems due to the fact that software which I was
compiling called CMake itself and so the projects that were being
included and automatically compiled in the process were failing even
if I set those two flags. OK, the fact that these two flags weren't
passed to the "child build" was clearly a bug in that software that
needs to fixed, but still.

Why is the default behavior of CMake to always add -isysroot unless
instructed otherwise?

I'm compiling from command-line, using "cmake -D<flag1> -D<flag2> ..."
generating gnu makefiles, using CMake version 3.0.0 and clang as the
compiler.

The reason why I was struggling was because I had to compile C++11
code on OS X 10.6 and have installed libc++ in /usr/lib, but -isysroot
reported a broken C++ compiler when that library was absent from the
SDK. While that might be a strange reason, there might be other valid
cases when one really expects the default behaviour when not passing
any flags.

Thank you,
    Mojca
-- 

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

Reply via email to