[CMake] cmake link against Qt4's OpenGL

Michael Jackson mike.jackson at bluequartz.net
Fri Sep 26 16:22:56 EDT 2008


You are building on 10.5 using the 10.4u sdk. Why. If you need to  
deploy on 10.4 then you will need to add the following CMAKE_C_FLAGS  
and CMAKE_CXX_FLAGS to your compile.

-mmacosx-version-min=10.4.

and change the CMAKE_OSX_SYSROOT to 10.5.sdk.

This scenario will make sure your app can run on 10.4 and 10.5. IF you  
use the 10.4u SDK then the MAXIMUM version of OS X that would be  
officially supported is 10.4. It _may_ run on 10.5 but there is no  
guarantee..

There is a bug/feature request to add the OSX_DEPLOYMENT_TARGET to  
cmake as a standard option for OS X  users. It is bug 6195 if you are  
interested. Most of the work has been done. Some cleanup still is  
waiting for me.

Mike

On Sep 26, 2008, at 4:12 PM, Linge Bai wrote:

> After I used cmake 2.6.1, with CMakeList.txt:
>
> PROJECT ( COMBINED )
> FIND_PACKAGE (Qt4 REQUIRED)
> SET(QT_USE_QTOPENGL TRUE)
> INCLUDE( ${QT_USE_FILE} )
> ADD_EXECUTABLE(exe main.cpp glwidget.cpp window.cpp)
> TARGET_LINK_LIBRARIES(exe ${QT_LIBRARIES})
>
> I am able to link to Qt4's OpenGL, but I have a link error:
>
> make
> Scanning dependencies of target exe
> Linking CXX executable exe
> ld: library not found for -lcrt1.10.5.o
>
> collect2: ld returned 1 exit status
> make[2]: *** [exe] Error 1
> make[1]: *** [CMakeFiles/exe.dir/all] Error 2
> make: *** [all] Error 2
>
> Does anyone know how to solve this?
>
> thanks,
> Linge
>
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list