Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8365807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:45:02+00:00 2026-06-09T12:45:02+00:00

I have been trying to include the latest version of qextserialport into the project

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:45:03+00:00Added an answer on June 9, 2026 at 12:45 pm

    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.

    #############
    ## basic FindQxt.cmake
    ## This is an *EXTREMELY BASIC* cmake find/config file for
    ## those times you have a cmake project and wish to use
    ## libQxt.
    ##
    ## It should be noted that at the time of writing, that
    ## I (mschnee) have an extremely limited understanding of the
    ## way Find*.cmake files work, but I have attempted to
    ## emulate what FindQt4.cmake and a few others do.
    ##
    ##  To enable a specific component, set your QXT_USE_${modname}:
    ##  SET(QXT_USE_QXTCORE TRUE)
    ##  SET(QXT_USE_QXTGUI FALSE)
    ##  Currently available components:
    ##  QxtCore, QxtGui, QxtNetwork, QxtWeb, QxtSql
    ##  Auto-including directories are enabled with INCLUDE_DIRECTORIES(), but
    ##  can be accessed if necessary via ${QXT_INCLUDE_DIRS}
    ##
    ## To add the libraries to your build, TARGET_LINK_LIBRARIES(), such as...
    ##  TARGET_LINK_LIBRARIES(YourTargetNameHere ${QXT_LIBRARIES})
    ## ...or..
    ##  TARGET_LINK_LIBRARIES(YourTargetNameHere ${QT_LIBRARIES} ${QXT_LIBRARIES})
    ################### TODO:
    ##      The purpose of this cmake file is to find what components
    ##  exist, regardless of how libQxt was build or configured, thus
    ##  it should search/find all possible options.  As I am not aware
    ##  that any module requires anything special to be used, adding all
    ##  modules to ${QXT_MODULES} below should be sufficient.
    ##      Eventually, there should be version numbers, but
    ##  I am still too unfamiliar with cmake to determine how to do
    ##  version checks and comparisons.
    ##      At the moment, this cmake returns a failure if you
    ##  try to use a component that doesn't exist.  I don't know how to
    ##  set up warnings.
    ##      It would be nice having a FindQxt.cmake and a UseQxt.cmake
    ##  file like done for Qt - one to check for everything in advance
    
    ##############
    
    ###### setup
    SET(QXT_MODULES QxtGui QxtWeb QxtZeroConf QxtNetwork QxtSql QxtBerkeley QxtCore)
    SET(QXT_FOUND_MODULES)
    FOREACH(mod ${QXT_MODULES})
        STRING(TOUPPER ${mod} U_MOD)
        SET(QXT_${U_MOD}_INCLUDE_DIR NOTFOUND)
        SET(QXT_${U_MOD}_LIB_DEBUG NOTFOUND)
        SET(QXT_${U_MOD}_LIB_RELEASE NOTFOUND)
        SET(QXT_FOUND_${U_MOD} FALSE)
    ENDFOREACH(mod)
    SET(QXT_QXTGUI_DEPENDSON QxtCore)
    SET(QXT_QXTWEB_DEPENDSON QxtCore QxtNetwork)
    SET(QXT_QXTZEROCONF_DEPENDSON QxtCore QxtNetwork)
    SET(QXT_QXTNETWORK_DEPENDSON QxtCore)
    SET(QXT_QXTQSQL_DEPENDSON QxtCore)
    SET(QXT_QXTBERKELEY_DEPENDSON QxtCore)
    
    FIND_PATH(QXT_DIR libqxt.pro Qxt/include/QxtCore/Qxt)
    FIND_PATH(QXT_BINARY_DIR 
        NAMES QxtCore.dll QxtCored.dll 
        PATHS 
        ${QXT_DIR}/bin  
        ${QXT_DIR}/Bin 
        NO_DEFAULT_PATH
    )
    
    #SET(QXT_BINARY_DIR "${QXT_DIR}/bin" CACHE PATH "${QXT_DIR}/bin")
    
    FOREACH(mod ${QXT_MODULES})
        STRING(TOUPPER ${mod} U_MOD)
        FIND_PATH(QXT_${U_MOD}_INCLUDE_DIR ${mod}
            PATH_SUFFIXES ${mod} include/${mod} Qxt/include/${mod} include/Qxt/${mod}
            PATHS
            ~/Library/Frameworks/
            /Library/Frameworks/
            /sw/
            /usr/local/
            /usr
            /opt/local/
            /opt/csw
            /opt
            "C:\\"
            "C:\\Program Files\\"
            "C:\\Program Files(x86)\\"
            ${QXT_DIR}
            NO_DEFAULT_PATH
        )
        FIND_LIBRARY(QXT_${U_MOD}_LIB_RELEASE NAME ${mod}
            PATH_SUFFIXES Qxt/lib64 Qxt/lib lib64 lib
            PATHS
            /sw
            /usr/local
            /usr
            /opt/local
            /opt/csw
            /opt
            "C:\\"
            "C:\\Program Files"
            "C:\\Program Files(x86)"
            ${QXT_DIR}
            NO_DEFAULT_PATH
        )
        FIND_LIBRARY(QXT_${U_MOD}_LIB_DEBUG NAME ${mod}d
            PATH_SUFFIXES Qxt/lib64 Qxt/lib lib64 lib
            PATHS
            /sw
            /usr/local
            /usr
            /opt/local
            /opt/csw
            /opt
            "C:\\"
            "C:\\Program Files"
            "C:\\Program Files(x86)"
            ${QXT_DIR}
            NO_DEFAULT_PATH
        )
        IF (QXT_${U_MOD}_LIB_RELEASE)
            SET(QXT_FOUND_MODULES "${QXT_FOUND_MODULES} ${mod}")
        ENDIF (QXT_${U_MOD}_LIB_RELEASE)
    
        IF (QXT_${U_MOD}_LIB_DEBUG)
            SET(QXT_FOUND_MODULES "${QXT_FOUND_MODULES} ${mod}")
        ENDIF (QXT_${U_MOD}_LIB_DEBUG)
    ENDFOREACH(mod)
    
    FOREACH(mod ${QXT_MODULES})
        STRING(TOUPPER ${mod} U_MOD)
        IF(QXT_${U_MOD}_INCLUDE_DIR AND QXT_${U_MOD}_LIB_RELEASE)
            SET(QXT_FOUND_${U_MOD} TRUE)
        ENDIF(QXT_${U_MOD}_INCLUDE_DIR AND QXT_${U_MOD}_LIB_RELEASE)
    ENDFOREACH(mod)
    
    
    ##### find and include
    # To use a Qxt Library....
    #   SET(QXT_FIND_COMPONENTS QxtCore, QxtGui)
    # ...and this will do the rest
    IF( QXT_FIND_COMPONENTS )
        FOREACH( component ${QXT_FIND_COMPONENTS} )
            STRING( TOUPPER ${component} _COMPONENT )
            SET(QXT_USE_${_COMPONENT}_COMPONENT TRUE)
        ENDFOREACH( component )
    ENDIF( QXT_FIND_COMPONENTS )
    
    SET(QXT_LIBRARIES "")
    SET(QXT_INCLUDE_DIRS "")
    
    # like FindQt4.cmake, in order of dependence
    FOREACH( module ${QXT_MODULES} )
        STRING(TOUPPER ${module} U_MOD)
        IF(QXT_USE_${U_MOD} OR QXT_DEPENDS_${U_MOD})
            IF(QXT_FOUND_${U_MOD})
                STRING(REPLACE "QXT" "" qxt_module_def "${U_MOD}")
                ADD_DEFINITIONS(-DQXT_${qxt_module_def}_LIB)
                SET(QXT_INCLUDE_DIRS ${QXT_INCLUDE_DIRS} ${QXT_${U_MOD}_INCLUDE_DIR})
                INCLUDE_DIRECTORIES(${QXT_${U_MOD}_INCLUDE_DIR})
                SET(QXT_LIBRARIES ${QXT_LIBRARIES};optimized;${QXT_${U_MOD}_LIB_RELEASE};debug;${QXT_${U_MOD}_LIB_DEBUG})
            ELSE(QXT_FOUND_${U_MOD})
                MESSAGE("Could not find Qxt Module ${module}")
                RETURN()
            ENDIF(QXT_FOUND_${U_MOD})
            FOREACH(dep QXT_${U_MOD}_DEPENDSON)
                SET(QXT_DEPENDS_${dep} TRUE)
            ENDFOREACH(dep)
        ENDIF(QXT_USE_${U_MOD} OR QXT_DEPENDS_${U_MOD})
    ENDFOREACH(module)
    MESSAGE(STATUS "Found Qxt Libraries:${QXT_FOUND_MODULES}")
    
    MESSAGE(STATUS "Include directories:${QXT_INCLUDE_DIRS}")
    

    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

    SET(QXT_FIND_COMPONENTS QxtCore, QxtGui)
    SET(QXT_USE_QXTCORE TRUE)
    FIND_PACKAGE(Qxt REQUIRED)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to include DirectX in C sharp project (Visual Studio 2010).
I have been trying to add a .cu file into my own(dll) win32 project
I've been trying to get the CEDET working with a simple project for the
I have been trying to execute this program on my MinGW, through Code::Blocks: #include
I have been trying to update my include paths to include phpDocumentor, but regardless
I have been trying to create a dynamic range within excel that would include
In my Windows 8 app, I have been trying to include a web image
I have been trying to understand of this following C-program: #include <stdio.h> int arr[]
I have been trying to get a project of mine to run but I
I have been trying to figure out the best way to include my PDO

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.