summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8e85155)
raw | patch | inline | side by side (parent: 8e85155)
author | tweenk <tweenk@users.sourceforge.net> | |
Sun, 11 Jan 2009 21:21:20 +0000 (21:21 +0000) | ||
committer | tweenk <tweenk@users.sourceforge.net> | |
Sun, 11 Jan 2009 21:21:20 +0000 (21:21 +0000) |
CMakeScripts/UseGlibMarshal.cmake | patch | blob | history |
index 6f81730e5a2e943dae2b7ad7610f1630b1116202..63d501a5798696bf7b4b97a8a76e58bcf42b85b4 100644 (file)
EXECUTE_PROCESS(COMMAND ${GLIB_MARSHAL_EXECUTABLE} --prefix=${GLIB_MARSHAL_PREFIX} --body ${CMAKE_CURRENT_SOURCE_DIR}/${GLIB_MARSHAL_FILE}.list
OUTPUT_VARIABLE GLIB_MARSHAL_OUTPUT_CPP )
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.h "${GLIB_MARSHAL_OUTPUT_HEADER}")
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.cpp "${GLIB_MARSHAL_OUTPUT_EXTRA_LINE}")
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.cpp "${GLIB_MARSHAL_OUTPUT_CPP}")
- ENDIF(GLIB_MARSHAL_EXECUTABLE)
-ENDMACRO(GLIB_MARSHAL)
+ # check whether the generated file is the same as the existing one
+ FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.h GLIB_MARSHAL_HEADER_OLD)
+ IF(NOT GLIB_MARSHAL_HEADER_OLD STREQUAL GLIB_MARSHAL_OUTPUT_HEADER)
+ MESSAGE(STATUS "${GLIB_MARSHAL_FILE}.h changed; overwriting")
+ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.h "${GLIB_MARSHAL_OUTPUT_HEADER}")
+ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.cpp "${GLIB_MARSHAL_OUTPUT_EXTRA_LINE}")
+ FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_FILE}.cpp "${GLIB_MARSHAL_OUTPUT_CPP}")
+ ELSE()
+ MESSAGE(STATUS "${GLIB_MARSHAL_FILE}.h unchanged")
+ ENDIF()
+ ENDIF()
+ENDMACRO()
+