QtCreator 4.2 - CMake ROS project



  • Hello,

    I use Qt Creator as IDE with ROS framework that use CMake for build process. With Qt Creator 3.x I only open the CMakeList file and it configures the project but since I installed Qt Creator 4.2 it start to fail:

    Running "/usr/bin/cmake /home/ze/catkin/src/WiiGo_sw/wiigo_safe '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_PREFIX_PATH:STRING=/home/ze/Qt/5.5/gcc_64 -DQT_QMAKE_EXECUTABLE:STRING=/home/ze/Qt/5.5/gcc_64/bin/qmake -Droscpp_DIR:PATH=/opt/ros/indigo/share/roscpp/cmake/roscppConfig.cmake" in /tmp/qtc-cmake-X0aSlj.
    -- The C compiler identification is GNU 4.8.4
    -- The CXX compiler identification is GNU 4.8.4
    -- Check for working C compiler: /usr/bin/gcc
    -- Check for working C compiler: /usr/bin/gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/g++
    -- Check for working CXX compiler: /usr/bin/g++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Using CATKIN_DEVEL_PREFIX: /tmp/qtc-cmake-X0aSlj/devel
    -- Using CMAKE_PREFIX_PATH: /home/ze/Qt/5.5/gcc_64
    -- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
    -- Using PYTHON_EXECUTABLE: /usr/bin/python
    -- Using Debian Python package layout
    -- Using empy: /usr/bin/empy
    -- Using CATKIN_ENABLE_TESTING: ON
    -- Call enable_testing()
    -- Using CATKIN_TEST_RESULTS_DIR: /tmp/qtc-cmake-X0aSlj/test_results
    -- Looking for include file pthread.h
    -- Looking for include file pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Found gtest sources under '/usr/src/gtest': gtests will be built
    -- Using Python nosetests: /usr/bin/nosetests-2.7
    -- catkin 0.6.18
    CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
      Could not find a package configuration file provided by "roscpp" with any
      of the following names:
    
        roscppConfig.cmake
        roscpp-config.cmake
    
      Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
      "roscpp_DIR" to a directory containing one of the above files.  If "roscpp"
      provides a separate development package or SDK, be sure it has been
      installed.
    Call Stack (most recent call first):
      CMakeLists.txt:7 (find_package)
    
    
    -- Could not find the required component 'roscpp'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
    -- Configuring incomplete, errors occurred!
    See also "/tmp/qtc-cmake-X0aSlj/CMakeFiles/CMakeOutput.log".
    See also "/tmp/qtc-cmake-X0aSlj/CMakeFiles/CMakeError.log".
    CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
      Could not find a package configuration file provided by "roscpp" with any
      of the following names:
    
        roscppConfig.cmake
        roscpp-config.cmake
    
      Add the installation prefix of "roscpp" to CMAKE_PREFIX_PATH or set
      "roscpp_DIR" to a directory containing one of the above files.  If "roscpp"
      provides a separate development package or SDK, be sure it has been
      installed.
    Call Stack (most recent call first):
      CMakeLists.txt:7 (find_package)
    
    
    *** cmake process exited with exit code 1.
    

    For some reason -DCMAKE_PREFIX_PATH:STRING=/home/ze/Qt/5.5/gcc_64 and it should be -DCMAKE_PREFIX_PATH:STRING=home/ze/catkin/devel;/opt/ros/indigo

    Now I need to change it on Projects tab for all the projects.

    It is defined as a global var:

    ze@ze-FI:~$ echo $CMAKE_PREFIX_PATH
    /home/ze/catkin/devel:/opt/ros/indigo
    

    I saw on Build & Run > Kits that there is a new option CMake Configuration
    What are the consequences if I change CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} to CMAKE_PREFIX_PATH:STRING=home/ze/catkin/devel;/opt/ros/indigo ?



  • Exactly that all projects that use that kit get this setting for CMAKE_PREFIX_PATH :)



  • @ziller said in QtCreator 4.2 - CMake ROS project:

    Exactly that all projects that use that kit get this setting for CMAKE_PREFIX_PATH :)

    I know that... What I want to know is what could be wrong removing %{Qt:QT_INSTALL_PREFIX} from the path.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.