Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. using cmake for Scxml

using cmake for Scxml

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 789 Views 2 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.
  • W Offline
    W Offline
    wpmccormick
    wrote on last edited by
    #1

    I've started using scxml with cmake, and it's been challenging since all the examples that I can find are using qmake; lot's of time wasted trying different things drudged up around the Internet.

    Is there some place I should be able to find how to properly build a an scxml application (using cmake) with out looking at random stackoverflow posts?

    Thanks!

    1 Reply Last reply
    1
    • W Offline
      W Offline
      wpmccormick
      wrote on last edited by
      #4

      Since I'm actually using catkin tools on-top of cmake, some of the key things were as follows:

      list(APPEND CMAKE_PREFIX_PATH /opt/ros/$ENV{ROS_DISTRO})
      list(APPEND CMAKE_PREFIX_PATH /opt/Qt5.12.2/5.12.2/gcc_64)

      find_package(Qt5 REQUIRED COMPONENTS
      Core
      Widgets
      Scxml
      )

      #CMAKE_AUTOMOC does not work!!
      qt5_wrap_cpp(SCXML_MOC
      include/ros_scxml_state.h
      include/ros_scxml.h
      )

      target_link_libraries(${PROJECT_NAME}_SM
      ${catkin_LIBRARIES}
      Qt5::Core
      Qt5::Scxml
      Qt5::Widgets
      )

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi and welcome to the forums.
        qmake is the official tool at least until Qt6 so you have to dig up info regarding
        qmake to cmake yourself as there is only setup info with QCreator
        https://doc.qt.io/qtcreator/creator-project-cmake.html

        so i guess you found
        https://stackoverflow.com/questions/44989571/qt-statemachine-scxml-in-cmake-project-without-pro-file

        1 Reply Last reply
        2
        • W Offline
          W Offline
          wpmccormick
          wrote on last edited by wpmccormick
          #3

          Yes, and it didn't work; I should try it again. There were 1 or 2 more as well that eventually got me to the point of "it looks like it compiled". But then it was time to go.

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wpmccormick
            wrote on last edited by
            #4

            Since I'm actually using catkin tools on-top of cmake, some of the key things were as follows:

            list(APPEND CMAKE_PREFIX_PATH /opt/ros/$ENV{ROS_DISTRO})
            list(APPEND CMAKE_PREFIX_PATH /opt/Qt5.12.2/5.12.2/gcc_64)

            find_package(Qt5 REQUIRED COMPONENTS
            Core
            Widgets
            Scxml
            )

            #CMAKE_AUTOMOC does not work!!
            qt5_wrap_cpp(SCXML_MOC
            include/ros_scxml_state.h
            include/ros_scxml.h
            )

            target_link_libraries(${PROJECT_NAME}_SM
            ${catkin_LIBRARIES}
            Qt5::Core
            Qt5::Scxml
            Qt5::Widgets
            )

            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