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. no rule to make target for importing existing CMake project

no rule to make target for importing existing CMake project

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 2.7k Views
  • 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.
  • M Offline
    M Offline
    mke48
    wrote on last edited by
    #1

    I am trying to import a project with C++ files that I already built using cmake and makefile. I am trying to import it into QT creator. However, after importing the project and trying to debug it, I get the error "no rule to make target". However, the file it is referring to exists and I never had this problem with that file when using cmake. What is going on?

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

      Hi,

      How are you importing the project ?

      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
      0
      • M Offline
        M Offline
        mke48
        wrote on last edited by
        #3

        I went to 'open file or project' and I then opened the .creator of the project

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Why not directly open the CMakeList.txt of your project ?

          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
          0
          • M Offline
            M Offline
            mke48
            wrote on last edited by
            #5

            Even if I try to directly open the CMakeLists.txt, I get the same no rule to make target error

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mke48
              wrote on last edited by
              #6

              When I did Try File -> Open File or Project and select the existing CMakeLists.txt file in Project/src/Project/ and then had Qt Creator use cmake to build it, I get the error "CMake Error at CMakeLists.txt:165 (SetupBoost): Unknown CMake command "SetupBoost".

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                SetupBoost ? Isn't that to build boost itself ?

                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
                0
                • M Offline
                  M Offline
                  mke48
                  wrote on last edited by
                  #8

                  SetupBoost.cmake is in ws/mke48/cmake/Project/CMake/SetupBoost.cmake

                  I generated the makefile (before using Qt) by going to ws/mke48/cmake/Project/Build, running 'ccmake' with the CMakeLists in the root source folder, pressing 'c' for configure, 'g' to generate the makefiles, 'make', 'ccmake' again, setting PRE_BUILD to false/off, 'c' again, 'g' again, and 'make' again

                  The contents for SetupBoost.cmake is below:

                  [CODE]macro(IncludeBoost)
                  set(Boost_FOUND FOUND)
                  set(Boost_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third-party/boost)
                  endmacro(IncludeBoost)

                  macro(find_boost)
                  set(Boost_FOUND FOUND)
                  set(Boost_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third-party/boost)
                  set(Boost_components thread date_time regex filesystem system program_options)
                  endmacro(find_boost)

                  macro(SetupBoost TargetName)

                  message("Setting up boost for target ${TargetName}")

                  set(Boost_FOUND FOUND)
                  set(Boost_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third-party/boost)

                  if (NOT DEFINED Boost_USE_MULTITHREADED)

                  set(Boost_LIBRARIES boost_thread-mt boost_date_time-mt boost_regex-mt boost_filesystem-mt boost_system-mt boost_program_options-mt)
                  target_link_libraries(${TargetName} ${Boost_LIBRARIES})
                  endmacro(SetupBoost)[/CODE]

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Are you sure Qt Creator is using the same cmake as you on the command line ?

                    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
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved