[cmake-commits] clinton committed FindQt4.cmake 1.87 1.88

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jan 29 13:07:54 EST 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv7406

Modified Files:
	FindQt4.cmake 
Log Message:

ENH:  Allow QT4_WRAP_CPP to work with dir1/myobject.h dir2/myobject.h
      Fixes #5067.



Index: FindQt4.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindQt4.cmake,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- FindQt4.cmake	29 Jan 2008 00:20:00 -0000	1.87
+++ FindQt4.cmake	29 Jan 2008 18:07:52 -0000	1.88
@@ -898,6 +898,16 @@
       ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
     ENDFOREACH(_currentArg) 
   ENDMACRO (QT4_EXTRACT_OPTIONS)
+  
+  # macro used to create the names of output files preserving relative dirs
+  MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
+    FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+    SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+    GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
+    GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
+    FILE(MAKE_DIRECTORY ${outpath})
+    SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+  ENDMACRO (QT4_MAKE_OUTPUT_FILE )
 
   MACRO (QT4_GET_MOC_INC_DIRS _moc_INC_DIRS)
      SET(${_moc_INC_DIRS})
@@ -949,8 +959,7 @@
 
     FOREACH (it ${moc_files})
       GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
-      GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
-      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx)
+      QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
       QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_includes}" "${moc_options}")
       SET(${outfiles} ${${outfiles}} ${outfile})
     ENDFOREACH(it)



More information about the Cmake-commits mailing list