I have been trying to include the latest version of qextserialport into the project I am working on. The project structure is as below:
- CameraProject
- CameraProject.pro
- CameraProject
- Headers
- Sources
- qextserialport
- Headers
- Sources
My CMake file currently looks like so:
PROJECT(CameraProject)
FIND_PACKAGE(Qt4 REQUIRED)
FIND_LIBRARY(SIMPLONLIB lv.simplon lib)
FIND_LIBRARY(SIMPLONIMGPROC lv.simplon.imgproc lib)
SET(CameraProject_SOURCES include/lv.simplon.class.cpp camera.cpp main.cpp mainwindow.cpp osdep.cpp paint.cpp)
SET(CameraProject_HEADERS include/lv.simplon.class.h camera.h mainwindow.h osdep.h paint.h)
SET(CameraProject_RESOURCES icons.qrc)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_EXECUTABLE(CameraProject ${CameraProject_SOURCES}
${CameraProject_HEADERS_MOC}
${CameraProject_RESOURCES_RCC})
TARGET_LINK_LIBRARIES(CameraProject ${QT_LIBRARIES} ${SIMPLONLIB} ${SIMPLONIMGPROC})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} include QExtSerialPort/src)
And despite including the QextSerialPort files in the Include Directories, I get linker issues being drawn.
EDIT: More information!
Found here is the qextserialport.pri file that is included in CameraProject.pro like so: include(./QExtSerialPort/src/qextserialport.pri)
Should I be making a second CMakeLists file for the qextserialport library placed within the source folder?
Any input would be greatly appreciated, please do not hesitate to request for clarification or any further information.
What did for qxt is to use a cmake finder module instead of directly including the code into my projects. I then built qxt with qmake and let CMake find the libraries it creates.
I put this module in a sub directory of my root project called CMake/Modules and include it into cmake near the top of the root CMakeLists.txt using the following command:
# The following line will add additional finders to CMake without the need to be placed in the CMake install path LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules)And finally to have CMake find Qxt