[CMake] OSX deployment target confusion for 2.8.10

Matthew Brett matthew.brett at gmail.com
Tue Nov 6 15:29:21 EST 2012


Hi,

On Tue, Nov 6, 2012 at 11:10 AM, Brad King <brad.king at kitware.com> wrote:
> On 11/06/2012 01:37 PM, Matthew Brett wrote:
>> I've attached the diff of the configs.
>
> The diff for generator/CMakeFiles/shiboken.dir/link.txt shows
> identical link lines except that 2.8.10 adds
>
>  -isysroot /Developer/SDKs/MacOSX10.6.sdk
>
> to honor the CMAKE_OSX_SYSROOT.  The change was here:
>
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0a0877a
>
> among a whole series of changes needed to make things behave
> well on OS X 10.8 with Xcode 4.5.
>
> Where is your Qt framework installed?  Why doesn't the SDK
> see it?  On a Mac OS X 10.7 machine I see this:
>
>  $ readlink /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks
>  /Library/Frameworks

Qt framework was from the qt-mac-opensource-4.8.3.dmg installer, resulting in:

$ ls /Library/Frameworks | grep Qt
Qt3Support.framework
QtCore.framework
QtDBus.framework
QtDeclarative.framework
QtDesigner.framework
QtDesignerComponents.framework
QtGui.framework
QtHelp.framework
QtMultimedia.framework
QtNetwork.framework
QtOpenGL.framework
QtScript.framework
QtScriptTools.framework
QtSql.framework
QtSvg.framework
QtTest.framework
QtWebKit.framework
QtXml.framework
QtXmlPatterns.framework

> so the SDK should have all the system frameworks.

$ ls -al /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/
total 8
drwxr-xr-x  4 root  wheel  136 Jul 13 21:21 .
drwxr-xr-t  3 root  wheel  102 Feb 14  2011 ..
lrwxr-xr-x  1 root  wheel   19 Jul 13 21:21 Frameworks -> /Library/Frameworks
drwxr-xr-x  3 root  wheel  102 Jan  4  2011 PluginManager.framework

> Try setting your shell current working directory to the
> "generator" directory in the build tree, and then run the
> command from "link.txt" by hand.  Add "-v" to get verbose
> output about the linker invocation generated by the compiler
> front-end.

Ah - yes:

$ sh CMakeFiles/shiboken.dir/link.txt
ld: framework not found QtCore
collect2: ld returned 1 exit status

$ cat CMakeFiles/shiboken.dir/link.txt
/usr/bin/c++    -Wall -fvisibility=hidden -Wno-strict-aliasing -O3
-DNDEBUG -isysroot /Developer/SDKs/MacOSX10.6.sdk
-mmacosx-version-min=10.6 -Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/shiboken.dir/generator.cpp.o
CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/headergenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/overloaddata.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokengenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokennormalize.cpp.o
CMakeFiles/shiboken.dir/main.cpp.o  -o shiboken
../ApiExtractor/libapiextractor.a -framework QtCore -framework QtXml
-framework QtXmlPatterns -framework QtXml

Removing the added -isysroot allows the command to run:

$/usr/bin/c++    -Wall -fvisibility=hidden -Wno-strict-aliasing -O3
-DNDEBUG -mmacosx-version-min=10.6 -Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/shiboken.dir/generator.cpp.o
CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/headergenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/overloaddata.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokengenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokennormalize.cpp.o
CMakeFiles/shiboken.dir/main.cpp.o  -o shiboken
../ApiExtractor/libapiextractor.a -framework QtCore -framework QtXml
-framework QtXmlPatterns -framework QtXml
ld: warning: QString::~QString()has different visibility (default) in
../ApiExtractor/libapiextractor.a(abstractmetalang.cpp.o) and (hidden)
in CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
ld: warning: QString::~QString()has different visibility (default) in
../ApiExtractor/libapiextractor.a(typesystem.cpp.o) and (hidden) in
CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
ld: warning: QString::operator=(char const*)has different visibility
(default) in ../ApiExtractor/libapiextractor.a(typesystem.cpp.o) and
(hidden) in CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
ld: warning: QString::~QString()has different visibility (default) in
../ApiExtractor/libapiextractor.a(abstractmetabuilder.cpp.o) and
(hidden) in CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o

Output of adding -v:

$ /usr/bin/c++    -Wall -fvisibility=hidden -Wno-strict-aliasing -O3
-DNDEBUG -isysroot /Developer/SDKs/MacOSX10.6.sdk
-mmacosx-version-min=10.6 -Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/shiboken.dir/generator.cpp.o
CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/headergenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/overloaddata.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokengenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokennormalize.cpp.o
CMakeFiles/shiboken.dir/main.cpp.o  -o shiboken
../ApiExtractor/libapiextractor.a -framework QtCore -framework QtXml
-framework QtXmlPatterns -framework QtXml -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure
--disable-checking --enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin10
--program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10
--target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
 /usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2 -dynamic -arch
x86_64 -macosx_version_min 10.6 -syslibroot
/Developer/SDKs/MacOSX10.6.sdk -weak_reference_mismatches non-weak -o
shiboken -lcrt1.10.6.o -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin10/4.2.1
-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib -L.
-L/Users/mb312/usr/local/lib -L.
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1
-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1
-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../..
-search_paths_first -headerpad_max_install_names
CMakeFiles/shiboken.dir/generator.cpp.o
CMakeFiles/shiboken.dir/shiboken/cppgenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/headergenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/overloaddata.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokengenerator.cpp.o
CMakeFiles/shiboken.dir/shiboken/shibokennormalize.cpp.o
CMakeFiles/shiboken.dir/main.cpp.o ../ApiExtractor/libapiextractor.a
-framework QtCore -framework QtXml -framework QtXmlPatterns -framework
QtXml -lstdc++ -lSystem -lgcc -lSystem
ld: framework not found QtCore
collect2: ld returned 1 exit status

Best,

Matthew


More information about the CMake mailing list