[CMake] Compiling a project that uses Qt
Michael Jackson
mike.jackson at bluequartz.net
Wed May 27 13:27:07 EDT 2009
Try this example Project:
http://www.bluequartz.net/software/files/QtTest.zip
_________________________________________________________
Mike Jackson mike.jackson at bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio
On May 27, 2009, at 1:04 PM, Pascale B wrote:
> Hi,
>
> I have a project developed in visual Studio 2008, in C++. I was
> asked to compile it in Linux. I'm completely new to using CMAKE. I
> have created a CMakeLists.txt file for my project and was able to
> build successfully one library. However my main program needs Qt
> applications to run. Here is the file I have, I get an error of the
> type : QApplication no such file of directories. QApplication is
> included in this way: #include <QApplication> in top of a cpp file.
>
> Also I have moc files generated by Qt in my program, I have read
> about qt4_wrap_cpp, however I use qt3. What are the equivalent
> commands for qt3?
>
> Sorry if this question seems redundant for the mailing lists. I
> have read some posts concerning this but no one that could clearly
> guide me to the correct way.
>
> Thanks in advance for the much needed help or references,
> Pascale
>
> _________________________________________________________________________
> cmake_minimum_required(VERSION 2.6)
>
> project(MyProg)
>
> SET(CMAKE_BUILD_TYPE debug)
> set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE})
>
> # -- to include openGL, automatic detection by CMAKE
> INCLUDE(FindOpenGL)
> INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
>
>
> # Here is where I'm having problems...
> find_package(Qt3 REQUIRED)
> add_definitions(${QT_DEFINITIONS})
> include_directories(${QT_INCLUDE_DIR})
>
> INCLUDE_DIRECTORIES(src)
> INCLUDE_DIRECTORIES(inc)
>
> # -- Génération de la liste des fichiers sources
> file(
> GLOB_RECURSE
> source_files_3D
> src/*
> inc/*
> )
>
> # -- Déclaration de l'exécutable
> add_executable(
> MyProg_3D
> ${source_files_3D}
> )
>
> # On link notre projet avec les libs OpenGL
> TARGET_LINK_LIBRARIES( MyProg_3D ${OPENGL_LIBRARIES})
>
>
> Windows Live helps you keep up with all your friends, in one place.
> _______________________________________________
> 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
More information about the CMake
mailing list