Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Configuring projects using a cmakelist..
Forum Updated to NodeBB v4.3 + New Features

Configuring projects using a cmakelist..

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 815 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joned
    wrote on last edited by
    #1

    I am having some issues configuring projects given a cmakelist..

    The problem is that it is not capable of finding the package i need.

    What i don't get is that it works like a charm, when i from the terminal cmake it.. but becomes troublesome using qt.

    What is wrong??

    # Test CMake version
    CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
    
    # The name of the project
    PROJECT(rovi_rob)
    MESSAGE(${PROJECT_NAME} ":")
    
    # Used to resolve absolute path names
    SET(ROOT ${CMAKE_CURRENT_SOURCE_DIR})
    
    
    # Set the RobWork root (edit in .bashrc if necessary)
    SET(RW_ROOT $ENV{RW_ROOT})
    
    # Verbose mode prints more info when doing make
    set(CMAKE_VERBOSE_MAKEFILE false)
    
    # Set build type to release
    SET(CMAKE_BUILD_TYPE Release)
    MESSAGE("-- Build type: " ${CMAKE_BUILD_TYPE})
    
    # Use RobWork
    SET(RobWork_DIR ${RW_ROOT}/cmake) 
    FIND_PACKAGE(RobWork REQUIRED)
    INCLUDE_DIRECTORIES(SYSTEM ${ROBWORK_INCLUDE_DIRS} )
    LINK_DIRECTORIES( ${ROBWORK_LIBRARY_DIRS} )
    
    # Set the output dir for generated libraries and binaries
    SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${ROOT}/../bin/${CMAKE_BUILD_TYPE}" CACHE PATH "Runtime directory" FORCE)
    SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ROOT}/../libs/${CMAKE_BUILD_TYPE}" CACHE PATH "Library directory" FORCE)
    SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${ROOT}/../libs/${CMAKE_BUILD_TYPE}" CACHE PATH "Archive directory" FORCE)
    
    # Add the source files to build
    SET(SrcFiles main.cpp)
    
    # The shared library to build:
    ADD_EXECUTABLE(main ${SrcFiles})
    TARGET_LINK_LIBRARIES(main ${ROBWORK_LIBRARIES})
    
    MESSAGE(${PROJECT_NAME} " done!")
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What OS your running ?

      Does Qt Creator have access to the RW_ROOT environment variable ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved