Code

cmake: fix file names in marshal generation
authorjohanengelen <johanengelen@users.sourceforge.net>
Sat, 5 Apr 2008 18:24:58 +0000 (18:24 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sat, 5 Apr 2008 18:24:58 +0000 (18:24 +0000)
CMakeScripts/UseGlibMarshal.cmake
src/helper/CMakeLists.txt

index 6a6167bed82c769d7141d1ba58427a34524ff6ed..18c0a3234ffa1daa95eea4d58d69fc217ff6ed5c 100644 (file)
@@ -4,25 +4,24 @@
 #
 # And it defines the following variables:
 #  GLIB_MARSHAL_PREFIX - The name of the files
-#  GLIB_MARSHAL_LIST - File to Generate from
+#  GLIB_MARSHAL_FILE - File to Generate from (.list) and to generate to (.h and .cpp)
 #  GLIB_MARSHAL_OUTPUT_HEADER - Result of Generation
 #  GLIB_MARSHAL_OUTPUT_CPP - Result of Generation
 #  GLIB_MARSHAL_OUTPUT_LOCATION - Where we are putting the Output
 
 FIND_PROGRAM(GLIB_MARSHAL_EXECUTABLE NAMES glib-genmarshal PATHS /usr/local/bin )
 
-MACRO(GLIB_MARSHAL GLIB_MARSHAL_PREFIX GLIB_MARSHAL_LIST GLIB_MARSHAL_OUTPUT_LOCATION)
+MACRO(GLIB_MARSHAL GLIB_MARSHAL_PREFIX GLIB_MARSHAL_FILE GLIB_MARSHAL_OUTPUT_LOCATION)
     IF(GLIB_MARSHAL_EXECUTABLE)
-    SET(GLIB_MARSHAL_OUTPUT_TEMP)
-    SET(GLIB_MARSHAL_OUTPUT_EXTRA_LINE "#include \"${GLIB_MARSHAL_PREFIX}.h\" \n" )
+        SET(GLIB_MARSHAL_OUTPUT_EXTRA_LINE "#include \"${GLIB_MARSHAL_FILE}.h\" \n" )
 
-        EXECUTE_PROCESS(COMMAND "${GLIB_MARSHAL_EXECUTABLE} --prefix=${GLIB_MARSHAL_PREFIX} --header ${CMAKE_CURRENT_SOURCE_DIR}/${GLIB_MARSHAL_LIST}"
+        EXECUTE_PROCESS(COMMAND "${GLIB_MARSHAL_EXECUTABLE} --prefix=${GLIB_MARSHAL_PREFIX} --header ${CMAKE_CURRENT_SOURCE_DIR}/${GLIB_MARSHAL_FILE}.list"
                                 RESULT_VARIABLE GLIB_MARSHAL_OUTPUT_HEADER )
-        EXECUTE_PROCESS(COMMAND "${GLIB_MARSHAL_EXECUTABLE} --prefix=${GLIB_MARSHAL_PREFIX} --body ${CMAKE_CURRENT_SOURCE_DIR}/${GLIB_MARSHAL_LIST}"
+        EXECUTE_PROCESS(COMMAND "${GLIB_MARSHAL_EXECUTABLE} --prefix=${GLIB_MARSHAL_PREFIX} --body ${CMAKE_CURRENT_SOURCE_DIR}/${GLIB_MARSHAL_FILE}.list"
                                 RESULT_VARIABLE GLIB_MARSHAL_OUTPUT_CPP )
-#                        SET(GLIB_MARSHAL_OUTPUT_CPP "${GLIB_MARSHAL_OUTPUT_EXTRA_LINE}${GLIB_MARSHAL_OUTPUT_TEMP}")
-                        FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_PREFIX}.h "${GLIB_MARSHAL_OUTPUT_HEADER}")
-                        FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_PREFIX}.cpp "${GLIB_MARSHAL_OUTPUT_EXTRA_LINE}")
-                        FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${GLIB_MARSHAL_PREFIX}.cpp "${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)
index 4f4883bd3281b58508afc07fb391b95d923edf0b..0b704b289e5e0641a8ac400edb7cfe4c53883a25 100644 (file)
@@ -1,7 +1,7 @@
 include(UseGlibMarshal)
 
 SET(Marshal
-sp-marshal.list
+sp-marshal
 )
 
 GLIB_MARSHAL(sp_marshal ${Marshal} ${CMAKE_CURRENT_BINARY_DIR})