[CMake] static Qt linking while building other DLLs
Hey, I'd like to hard-link Qt in my application, while at the same time allowing some of my other libraries to build as DLLs. Last time I looked cmake just had a single 'either or' option for building either as shared libraries or without. Is there some way to do a mixed build like this, and more specifically, what exactly are the steps for static linking to Qt? Thanks and best wishes Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMake Xcode SCC
Hi all, I'm using Xcode 3.2.2 and Perforce for my Source Code Control. Whenever I rebuild the Xcode project with cmake, Xcode loses its connection to the source code server and I have to reset it manually. Does anyone have a solution for this? Thanks in advance Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] qt .qrc file modifications require two builds
Here's a very short example that demonstrates the problem. This is a CMake file for the "states" qt 4.6 example (Developer/Examples/Qt/animation/states) #--- PROJECT(states) # the name of your project CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project INCLUDE(${QT_USE_FILE}) SET ( states_SRCS main.cpp ) SET ( states_HEADERS main.h ) SET ( states_RESOURCES states.qrc ) QT4_WRAP_CPP( states_MOC_files ${states_HEADERS}) QT4_ADD_RESOURCES( states_RESOURCES_SOURCES ${states_RESOURCES} ) INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ) ADD_EXECUTABLE( states MACOSX_BUNDLE ${states_SRCS} ${states_MOC_files} ${states_RESOURCES_SOURCES} ) TARGET_LINK_LIBRARIES(states ${QT_LIBRARIES}) #--- Put this in the states directory, run CMake ./ -G Xcode Open the Xcode project and build. Builds fine. Next, open states.qrc, make any sort of modification, even just typing a space. Save the file. Build. You will notice the "run custom script" phase executes, but that's all. (qrc_states.cxx is generated) Press Build again. You will notice that qrc_states.cxx compiles and the project is relinked. That should have been done the first time. G ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] qt .qrc file modifications require two builds
Removed the globbing, same exact behavior. Any other ideas? Does this normally work for people? Any examples? G ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] qt .qrc file modifications require two builds
Really? How could it? Suppose I only have 1 qrc file, named foo.qrc: wouldn't these two lines be equivalent? FILE (GLOB my_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "res/*.qrc" ) SET( my_RESOURCES "res/foo.qrc") ??? TIA G On Tue, Dec 15, 2009 at 7:15 PM, John Drescher wrote: >> The CMake script in question looks more or less like: >> >> FILE (GLOB my_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "res/*.qrc" ) >> QT4_ADD_RESOURCES( my_RESOURCES_SOURCES ${my_RESOURCES} ) >> >> ... > > It's always best to not do any file globbing and add each file by > hand. I believe this is causing the problem. > > John > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] qt .qrc file modifications require two builds
If I modify my .qrc file, the first build regenerates the cxx output file, but the cxx file itself is not compiled and linked in until I build again. Is there a way to add an additional dependency to allow the system to realize that the cxx file needs a rebuild on the first pass? The CMake script in question looks more or less like: FILE (GLOB my_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "res/*.qrc" ) QT4_ADD_RESOURCES( my_RESOURCES_SOURCES ${my_RESOURCES} ) ... ADD_EXECUTABLE( myApp MACOSX_BUNDLE ${mySrcs} ${my_RESOURCES_SOURCES} ) Is there something else I should be doing? Building under Xcode. Thanks! G ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] SDL troubles on Mac OS X
>I think the SDL developers are just being a bit "too" slick. They are setting >up SDL for Xcode development where typically you would link to the SDL and >then have a "Copy Files Phase" where you copy the framework into the >Application Bundle that resides in the build directory. Its a cultural difference also. Mac developers think of creating the complete application as part of the build process. A Mac app generally contains everything it needs so you can just drag it to another machine and run it. I would never want a half-baked app that is wired into my machine. Copying the libraries into the app isn't part of "installation", its part of "building"... Copying the app somewhere else is "installation" i.e. a no-op as far as my build process is concerned. G ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] source_group with XCode?
Hi again, I'm trying to use the source_group command with XCode, and its marginally working, but in a flaky sorta way. I was wondering what other people have any tips. The behavior I'm seeing is: Groups in the form source_group( Name FILES ${source} ) Work OK, they add a top-level group to the current target's file list source_group( Name/SubName FILES ${source} ) XCode treats this as a single name, in other words I get groups named "Name/SubName" source_group( Name\SubName FILES ${source} ) and source_group( Name\\SubName FILES ${source} ) have the same behavior: The parent group name is dropped. I simply get groups named SubName. I guess or now I'll go with "/" in that it at least still represents the folder structure, and it sounds like maybe its more compatible with Visual Studio. Anything else I should try? Thanks! Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Anyone know what "foo.moc.rule" files are?
I have my Qt project building using CMake, but in the Xcode project I'm seeing references to missing foo.moc.rule files for each moc'd source file. The fact that they are missing doesn't seem to be hurting anything, but I'm wondering what they are, and if they're not needed, how I can get rid of them... Thanks in advance Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
>The subtle thing > about the Xcode Environment variables is that your CMake Code is run > at "Cmake Time" which will have no idea about the Xcode variables that > are set during a "Build Time". Right. But in my case this is OK, because I evaluate the Xcode env variable in my python script which is run at "build time" by Xcode and not at "CMake time"... I guess your code is doing something similar, but in the CMake universe... Just to make sure I understand what you're doing: You're quoting ${CONFIGURATION} when you assemble the CMD string, so it wont be evaluated until the command is actually run by Xcode, right? That's a neat way of doing it, because then I could theoretically build using vanilla make under OSX if I wanted to. I don't want to try to generate the framework into the app bundle itself. We've found you wind up with chicken-and-egg problems with this approach because the Framework needs to be built before the app so the app can link to it, but the app doesn't exist yet, etc etc. In your custom target approach, I would need a different target for each configuration? I'm actually happy using my python script to do the copy, because it can copy the whole framework, not just the dylib, and its also smart about not copying things that are not out of date. This is some code we'd already written so it was nice to be able to reuse it. Anyway I've got it all working now... Thanks for the help! Best wishes Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] where are the output files?
For a Xcode specific solution to this see my specFramework Installation Directory / Framework copying thread. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
Thanks Mike, I pretty much got my build process on the Mac working. The thing that took me awhile to understand were the different running contexts that bits of the CMake script are processed within. What I want is a little different than the standard way that things are done in the CMake way of handling Frameworks and bundles. I basically always want the Frameworks copied into the app, not just during the install phase. Here's what I'm doing: 1) In my framework CMakeLists.txt file, I have the following: IF (APPLE) SET_TARGET_PROPERTIES( MyFramework PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES( MyFramework PROPERTIES XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/ ) ENDIF (APPLE) The second "set_target_properties" line configures the framework to always be looked for in the application bundle in the Frameworks sub-folder. 2) In my top-level CMakeLists.txt file, I add setup a unified binary output directory (thanks Mike!): SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) 3) Then, in my applications' CMakeLists.txt file, I have the following: IF (APPLE) ADD_CUSTOM_COMMAND( TARGET MyApp POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_HOME_DIRECTORY}/CopyFramework.py --binary ${PROJECT_BINARY_DIR}/Bin --framework MyFramework.framework --app MyApp.app ) ENDIF (APPLE) This calls out to my python script, which does the work of assembling the src and dest paths, and actually copying the Framework. The final trick is that since this is a Mac only thing, I can rely on an Xcode environment variable within the Python script: config= os.environ["CONFIGURATION"] This allows me to assemble the complete path to the actual binary locations of the framework and the app. The one thing I wish was that there was a CMake variable that would expand to the current Config within the context of the ADD_CUSTOM_COMMAND... It'd be nice to not have to resort to using the Xcode environment variable. Thanks again Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] where are the output files?
Ok, this is something that I thought was going to be easy, but I really can't figure it out... I've written a python script to smash my private frameworks into my built application, but, I need to know exactly where the frameworks and the app have been built. I know I can control the top-level binary directory for each target when I do my ADD_SUBDIRECTORY, and I know each target's name, since I specify that, but I can't figure out how to find the current build configuration... For example, here's the information I need: /Users/me/Proj/build/App/Debug/MyApp.app/ /Users/me/Proj/build/Framework/Debug/MyFramework.framework/ The only part of this path that isn't under my control is the "Debug" part... I'm a bit overwhelmed by the number of paths floating around in the CMake universe. I've printed a bunch of them out, but none of them seem to be what I'm after. Any ideas? Thanks ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Framework Installation Directory / Framework copying
Hi all, Does anyone have any experience with how to copy a built framework into the application bundle? In Xcode we set the Installation Directory of the Framework to @executable_path/../Frameworks/, then as a post-link phase of building the app we run a python script to copy the built framework into the application bundle. I can set up the dependency between my app target and my framework target, and if I leave everything alone the app even runs. However, if I move the framework into the app bundle by hand, it won't launch because it can't find the framework. This is because the Installation Directory is being set to the BINARY_DIR location. If I by hand fix the Xcode project's Installation Directory to @executable_path/../Frameworks/ and rebuild, (and move it to the correct location by hand) everything works. (So, I know my suspicions about what needs to be done are correct). So, does anyone know how to set a Framework's Installation Directory parameter via CMake? Part of my problem in researching this problem is that "Installation Directory" is an overloaded term in the CMake lexicon. I'm talking about the OS X Framework attribute here, not the CPack or Squish variables. Also, any idea about the best way to do the Framework copy? I could probably just re-use our python script, but maybe there's a cleaner CMake way of doing something like this... Thanks in advance... Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] question about QT4_WRAP_CPP
I'm still playing around with the states Qt example, and I've hit something I don't understand: I can get everything working as expected with QT4_AUTOMOC, but not if I use QT4_WRAP_CPP. In the QT4_WRAP_CPP case, it seems the only way to get dependencies set up correctly is to add the MOC output to the target, i.e. QT4_WRAP_CPP( states_MOC_files ${states_HEADERS}) ADD_EXECUTABLE( states MACOSX_BUNDLE ${states_SRCS} ${states_MOC_files} ${states_RESOURCES_SOURCES} ) However, if I do this CMake adds the moc files (named in the form moc_foo.cxx) to the project to be compiled as C++ files. BUT, MOC files are not designed to be compiled on their own. Typically they are included at the bottom of the module that contains the source for the objects in question. They do not include all the headers that they need, and so they will not build independently. So, if I include the moc files in the ADD_EXECUTABLE line, my build doesn't work... but if I remove them, the dependency is not set up, so the moc files are not generated at all. How can I say "these files are required by this target, but don't try to compile them directly?" Or is there something else I should be doing? Thanks in advance Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] can't link simple qt example
Posting a solution to my previous problem I wasn't linking in the generated resource file. Here's a working very short CMake file for building the "states" Qt4.6 example: --- #basic stuff PROJECT(states) # the name of your project CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) #find qt, and include qt macros FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project INCLUDE(${QT_USE_FILE}) #set up src and rsrc variables SET( states_SRCS main.cpp ) SET( states_RESOURCES states.qrc ) #generate moc dependencies, generate "resources as compiled binary data" files QT4_AUTOMOC(${states_SRCS}) QT4_ADD_RESOURCES( states_RESOURCES_SOURCES ${states_RESOURCES} ) #the moc files will be generated into the binary directory. #Add this to the include search path so #include "main.moc" will work INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ) #make an executable target, and associate its sources, and declare what external libraries its depends on ADD_EXECUTABLE( states MACOSX_BUNDLE ${states_SRCS} ${states_RESOURCES_SOURCES} ) TARGET_LINK_LIBRARIES(states ${QT_LIBRARIES}) --- One thing of note: In order for QT4_AUTOMOC to work, I had to move the definition of the Pixmap class into a new header file named main.h. It seems in general putting your Q_OBJECT class defs in a header is required when building Qt projects under CMake... but there's probably some way around it. Cheers G On Fri, Dec 4, 2009 at 8:59 PM, Glenn Hughes wrote: > Hello all, I'm just getting going with CMake and qt, and I'm having a bit > of a problem. > I've assembled pretty much the simplest CMakeLists.txt file I can imagine > for a very simple example qt project. (I'm trying to build the qt 4.6 > "states" example using CMake.) > > When I build, I get the following link errors: > > /usr/bin/ld: warning suggest use of -bind_at_load, as lazy binding may > result in errors or different symbols being used > /usr/bin/ld: Undefined symbols: > qInitResources_states() > /Developer/Examples/Qt/animation/states/states.build/Debug/states.build/Objects-normal/i386/main.o > reference to undefined qInitResources_states() > symbol typeinfo for QFactoryInterfaceused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo for QEventTransitionPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo for QAbstractItemModelPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo for QAbstractEventDispatcherPrivateused from dynamic > library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo name for QFactoryInterfaceused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo name for QEventTransitionPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo name for QAbstractItemModelPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol typeinfo name for QAbstractEventDispatcherPrivateused from dynamic > library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol vtable for QFactoryInterfaceused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol vtable for QEventTransitionPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single > module) not from earlier dynamic library > QtGui.framework/Versions/4/QtGui(single module) > symbol vtable for QAbstractItemModelPrivateused from dynamic library > /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCo
[CMake] FindQT4 documentation?
Hi all, Is FindQT4 documented anywhere? I've found it referenced through a few examples, but googling for it mostly yields bug reports rather than information. Thanks! Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] can't link simple qt example
Hello all, I'm just getting going with CMake and qt, and I'm having a bit of a problem. I've assembled pretty much the simplest CMakeLists.txt file I can imagine for a very simple example qt project. (I'm trying to build the qt 4.6 "states" example using CMake.) When I build, I get the following link errors: /usr/bin/ld: warning suggest use of -bind_at_load, as lazy binding may result in errors or different symbols being used /usr/bin/ld: Undefined symbols: qInitResources_states() /Developer/Examples/Qt/animation/states/states.build/Debug/states.build/Objects-normal/i386/main.o reference to undefined qInitResources_states() symbol typeinfo for QFactoryInterfaceused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo for QEventTransitionPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo for QAbstractItemModelPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo for QAbstractEventDispatcherPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo name for QFactoryInterfaceused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo name for QEventTransitionPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo name for QAbstractItemModelPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol typeinfo name for QAbstractEventDispatcherPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol vtable for QFactoryInterfaceused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol vtable for QEventTransitionPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol vtable for QAbstractItemModelPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) symbol vtable for QAbstractEventDispatcherPrivateused from dynamic library /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/QtCore.framework/QtCore(single module) not from earlier dynamic library QtGui.framework/Versions/4/QtGui(single module) collect2: ld returned 1 exit status Here's my CMakeLists.txt file, which I've cobbled together from various online examples: project(states) cmake_minimum_required(VERSION 2.4.0) find_package(Qt4 REQUIRED) FIND_PACKAGE( Qt4 COMPONENTS QtCore QtGui ) # don't know if this was necessary... I'm grasping at straws trying to force link ordering include(${QT_USE_FILE}) set(states_SRCS main.cpp ) qt4_automoc(${states_SRCS}) SET( states_RESOURCES_SOURCES states.qrc ) QT4_ADD_RESOURCES( states_RESOURCES_SOURCES ${states_RESOURCES} ) INCLUDE_DIRECTORIES( . ) SET(QT_LIBS "${QT_LIBRARIES}") ADD_EXECUTABLE( states MACOSX_BUNDLE ${states_SRCS} ) target_link_libraries(states ${QT_LIBRARIES}) #--- Here's the command output: Ld /Developer/Examples/Qt/animation/states/Debug/states.app/Contents/MacOS/states normal i386 cd /Developer/Examples/Qt/animation/states /usr/bin/g++-4.0 -o /Developer/Examples/Qt/animation/states/Debug/states.app/Contents/MacOS/states -L/Developer/Examples/Qt/animation/states/Debug -F/Developer/Examples/Qt/animation/states/Debug -F/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks -filelist /Developer/Examples/Qt/animation/states/states.build/Debug/states.build/Objects-normal/i386/states.LinkFileList -arch i386 -Wl,-Y,1455 -mmacosx-version-min=10.4 -Wl,-search_paths_first -headerpad_max_install_names -framework QtGui -framework Carbon -framework AppKit -framework QtCore /usr/lib/libz.dylib -framework