Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Qt Creator Cmake "No executable specified" (CuteLyst)

    Tools
    2
    2
    395
    Loading More Posts
    • 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.
    • U
      Ucn_ last edited by

      Hello. I am trying to work with Cutelyst on Qt Creator. I am able to load the CMakeLists.txt with the settings to find my source files. It opens on Qt creator and with extra steps I fixed some issues "Qt::Core" and "Cutelyste::Core" not found. Now I am stuck on the build step. I do not know how to load the CMakeLists.txt (CMake file to build application).

      CMakeLists.txt Settings:

      file(GLOB_RECURSE ServerREST2_SRCS *.cpp *.h)
      
      set(ServerREST2_SRCS
          ${ServerREST2_SRCS}
          ${TEMPLATES_SRC}
      )
      
      find_package(Qt5 COMPONENTS Core Network REQUIRED)
      find_package(Cutelyst3Qt5 REQUIRED)
      
      # Create the application
       add_library(ServerREST2 SHARED ${ServerREST2_SRCS})
      
      # Link to Cutelyst
      target_link_libraries(ServerREST2
          Cutelyst::Core
          Qt5::Core
          Qt5::Network
      )
      

      CMakeLists.txt build file:

      project(ServerREST2)
      
      cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
      if (POLICY CMP0043)
        cmake_policy(SET CMP0043 NEW)
      endif()
      
      if(WIN32)
        if(MSVC)
          add_definitions(-D_SCL_SECURE_NO_WARNINGS)
          add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
        endif()
      endif()
      
      find_package(Qt5 COMPONENTS Core Network REQUIRED)
      find_package(Cutelyst2Qt5 REQUIRED)
      
      # Auto generate moc files
      set(CMAKE_AUTOMOC ON)
      
      # As moc files are generated in the binary dir, tell CMake
      # to always look for includes there:
      set(CMAKE_INCLUDE_CURRENT_DIR ON)
      
      file(GLOB_RECURSE TEMPLATES_SRC root/*)
      
      add_subdirectory(src)
      

      How to load the build file in Qt creator? The build file was generated along with the source files (apiv1.cpp apiv1.h root.cpp root.h serverrest2.cpp serverrest2.h) when creating the Cutelyst app. Do I need to include the executables like:

      add_executable(ServerREST2
          apiv1.cpp  
          root.cpp  
          serverrest2.cpp  
      )
      

      Thanks

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Are you able to build your project from the command line ?
        Which version of Qt Creator are you using ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post