July 27, 2011

mrtc3 mrtc3
Lab Rat
18 posts

CMake moc.exe and Paths - “\” “/”

 

Hi people,

I have a cmake file, inwhich has:

  1. # list all class files which implement Q_OBJECT
  2. QT4_WRAP_CPP( ${PROJECT_NAME}_MOCS
  3.     ${CMAKE_CURRENT_SOURCE_DIR}/src/MainWindow.h
  4.     ${CMAKE_CURRENT_SOURCE_DIR}/src/Canvas.h
  5.     ${CMAKE_CURRENT_SOURCE_DIR}/src/COptions.h
  6.  ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header1.h
  7.  ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header2.h
  8.  ${CMAKE_CURRENT_SOURCE_DIR}/path1/project2/Header3.h
  9. )

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:

  1. 2>------ Build started: Project: MainSolution, Configuration: Debug Win32 ------
  2. 2>Generating path1/project2/moc_Header1.cxx
  3. 2>moc: M:/Eigene Dateien/path1/project2/Header1.h: No such file
  4. 2>Project : error PRJ0019: A tool returned an error code from "Generating path1/project2/moc_Header1.cxx"
  5. 2>Build log was saved at "file://m:\Eigene Dateien\MainSolution.dir\Debug\BuildLog.htm"
  6. 2>MainSolution - 1 error(s), 0 warning(s)
  7. ========== 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

 Signature 

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

1 reply

July 27, 2011

mrtc3 mrtc3
Lab Rat
18 posts

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:

  1. # list all class files which implement Q_OBJECT
  2. QT4_WRAP_CPP( ${PROJECT_NAME}_MOCS
  3.     OldHeader.h
  4.  Header1.h
  5.  Header2.h
  6.  Header3.h
  7. )

 Signature 

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

 
  ‹‹ Unable to change Toolchain in QtCreator      [SOLVED] How can I auto switch to Edit layout from Debug layout once I am done debugging? ››

You must log in to post a reply. Not a member yet? Register here!