Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. CMake moc.exe and Paths - "\" "/"
QtWS25 Last Chance

CMake moc.exe and Paths - "\" "/"

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 3.1k 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
    mrtc3
    wrote on last edited by
    #1

    Hi people,

    I have a cmake file, inwhich has:
    @

    list all class files which implement Q_OBJECT

    QT4_WRAP_CPP( ${PROJECT_NAME}_MOCS
    ${CMAKE_CURRENT_SOURCE_DIR}/src/MainWindow.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/Canvas.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/COptions.h
    ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header1.h
    ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header2.h
    ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header3.h
    )
    @
    entered. I have entered the last 3 lines with Header1-3.h

    My plattform is Windows XP, Visual Studio 2008, Qt. I get this error when compiling:
    @
    2>------ Build started: Project: MainSolution, Configuration: Debug Win32 ------
    2>Generating path1/project2/moc_Header1.cxx
    2>moc: M:/Eigene Dateien/path1/project2/Header1.h: No such file
    2>Project : error PRJ0019: A tool returned an error code from "Generating path1/project2/moc_Header1.cxx"
    2>Build log was saved at "file://m:\Eigene Dateien\MainSolution.dir\Debug\BuildLog.htm"
    2>MainSolution - 1 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
    @

    In the CMakeList.txt I have to enter "/" otherwise I get error.
    But then "M:/Eigene Dateien/path1/project2/DialogWindowSettings.h" is not going to be found, because of the other slashes "/" instead of ""

    How do I solve this problem?

    Thank you very much

    Cheers mrt

    There are 10 types. Those who understand binary and those who don't .)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrtc3
      wrote on last edited by
      #2

      I just found out that the "/" is replaced automatically to corresponding OS' pathseperator; here ""
      I just wrote my header1-3.h files into the CMakeList.txt, which is located in path1/project2/ by adding there:

      @

      list all class files which implement Q_OBJECT

      QT4_WRAP_CPP( ${PROJECT_NAME}_MOCS
      OldHeader.h
      Header1.h
      Header2.h
      Header3.h
      )

      @

      There are 10 types. Those who understand binary and those who don't .)

      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