Results 1 to 3 of 3

Thread: Qt cmake project cannot find pakages

  1. #1
    Join Date
    Oct 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt cmake project cannot find pakages

    Hello there,

    I have an external project that has been set up to use CMake for compilation. I was just using a text editor and compiling at the command line but have decided to use Qt creator for the benefits an IDE bring.

    I followed the instructions for setting up a CMake project by opening the CMakeLists.txt file in my top directory. CMake runs but it cannot find some packages using pkgconfig, specifically OpenCV. Qt cannot build the project now because there is a lot of code dependant on OpenCV.

    If I run CMake at the command line it finds the OpenCV package. I'm at a loss as to why running CMake through Qt creator would cause a problem. The CMakeLists.txt files are all the same!!

    I've run

    Qt Code:
    1. daniel@daniel-linux:~$ pkg-config --cflags --libs opencv
    2. -I/opt/opencv-2.0.0/include/opencv -I/opt/opencv-2.0.0/include -L/opt/opencv-2.0.0/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
    To copy to clipboard, switch view to plain text mode 

    at the command line and opencv can be found.

    I'm using ubuntu 10.10, Qt creator 2.0.1 (based on Qt 4.7.0), CMake 2.8-patch 3 and trying to find OpenCV 2.0.0 which is installed in as above

    Am I missing a config param somewhere? Do I need to modify the PATH? Thought this is all handled in the CMakeLists.txt files.

    Any ideas?

  2. #2
    Join Date
    May 2014
    Posts
    1
    Platforms
    MacOS X Unix/X11

    Default Re: Qt cmake project cannot find pakages

    I know this is a pretty old post, but I am experiencing the exact same problem. Does anybody know how to solve it?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt cmake project cannot find pakages

    There is a difference in the environment between the command line where CMake finds the OpenCV install, and the environment that QtCreator is running the same CMake command and failing. I'd look at the PKG_CONFIG_PATH environment variable in both places (the error message from pkg-config tells you that when it fails).

Similar Threads

  1. Qt Creator Adding files to cmake project
    By xadian in forum Qt Tools
    Replies: 1
    Last Post: 1st April 2013, 15:18
  2. How to convert QT Project to CMake project?
    By Kevin Hoang in forum Qt Programming
    Replies: 2
    Last Post: 29th March 2011, 09:48
  3. Openning a qt project using cmake
    By Hogwarts in forum Newbie
    Replies: 1
    Last Post: 23rd February 2011, 18:48
  4. cmake kdelib,can not find automoc
    By toartist in forum KDE Forum
    Replies: 0
    Last Post: 1st October 2009, 08:05
  5. build project with cmake does not work
    By codebehind in forum Qt Programming
    Replies: 4
    Last Post: 18th August 2008, 12:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.