将cmake项目转换为qmake

时间:2016-07-26 02:50:33

标签: cmake qmake

我正在尝试将一个相当简单的CMakeLists.txt转换为qmake项目。该项目编译良好,但我无法得到我想要的输出(程序文件是相同的!)。

这不应该是一个大问题,但我花了一整天似乎无法弄清楚问题。任何帮助将不胜感激。

这是我想要转换的CMakeLists.txt:

cmake_minimum_required (VERSION 2.6) 
PROJECT (sdpwrapper) 

#set the default path for built executables to the "bin" directory
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

FIND_PACKAGE(OpenCV REQUIRED)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")

ADD_LIBRARY(objdettrack 
    ./src/MyPipe.cpp 
    ./src/SDPWrapper.cpp 
    ./src/online_tracker.cpp
    ./src/BaseObjectTracker2D.cpp)

INCLUDE_DIRECTORIES(include 
    /usr/include/python2.7 
    ../dep/NOMT/include/ 
    ../dep/NOMT/dep/eigen/ 
    ../dep/NOMT/dep/libDAI-0.3.2/include/)

TARGET_LINK_LIBRARIES(objdettrack
    ${PROJECT_SOURCE_DIR}/../dep/NOMT/lib/libcppmodule.so
    python2.7
    ${OpenCV_LIBS})

ADD_EXECUTABLE(example ./src/main.cpp)
TARGET_LINK_LIBRARIES(example objdettrack)

FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}")
ENDIF()

这是我创建的qmake项目文件:

QT       += widgets

TARGET = ./build/DummyProject
#CONFIG   += console
#CONFIG   -= app_bundle

SOURCES += ./src/main.cpp \
    ./src/MyPipe.cpp \
    ./src/online_tracker.cpp \
    ./src/SDPWrapper.cpp \
    ./src/BaseObjectTracker2D.cpp

TEMPLATE = app
#TEMPLATE += lib



# ZEESHAN:INTEGRATION CODE
INCLUDEPATH += ./include
INCLUDEPATH += /usr/include/python2.7 
INCLUDEPATH += /home/ma/zeeshan/code/Joint/KITTI_Jun2016/slam/app/faster-rcnn/dep/NOMT/include/ 
INCLUDEPATH += /home/ma/zeeshan/code/Joint/KITTI_Jun2016/slam/app/faster-rcnn/dep/NOMT/dep/eigen/ 
INCLUDEPATH += /home/ma/zeeshan/code/Joint/KITTI_Jun2016/slam/app/faster-rcnn/dep/NOMT/dep/libDAI-0.3.2/include/

QMAKE_LIBDIR += /home/ma/zeeshan/code/Joint/KITTI_Jun2016/slam/app/faster-rcnn/dep/NOMT/lib
LIBS += -lcppmodule
LIBS += -lpython2.7
LIBS += -lpynomt

QMAKE_LIBDIR += ../../faster-rcnn/cpp/lib
LIBS += -Lobjdettrack

CONFIG += link_pkgconfig
PKGCONFIG += opencv

QMAKE_CXXFLAGS+= -fopenmp
QMAKE_LFLAGS +=  -fopenmp

任何建议都将受到高度赞赏。

Zeeshan

0 个答案:

没有答案