Configuring projects using a cmakelist..



  • 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!")
    

  • Lifetime Qt Champion

    Hi,

    What OS your running ?

    Does Qt Creator have access to the RW_ROOT environment variable ?


Log in to reply
 

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