CMake moc.exe and Paths - “\” “/”
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
1 reply
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
- )
You must log in to post a reply. Not a member yet? Register here!
