From d6de5609edf9db6f9d3f9f0475cdcf272862e2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 27 Jan 2011 18:56:41 +0100 Subject: Remove marshallers from the tree and ignore them. Require glib-genmarshal (a part of the standard GTK+ distribution). --- CMakeLists.txt | 63 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0169eee..0b0e4fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,38 +166,37 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in include_directories (${CMAKE_CURRENT_BINARY_DIR}) # Generate marshallers +find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal) +if (NOT GLIB_GENMARSHAL_EXECUTABLE) + message (FATAL_ERROR "glib-genmarshal not found") +endif (NOT GLIB_GENMARSHAL_EXECUTABLE) + function (glib_genmarshal base prefix) - find_program (GLIB_GENMARSHAL_EXECUTABLE glib-genmarshal) - - if (GLIB_GENMARSHAL_EXECUTABLE) - get_filename_component (base_path "${base}" PATH) - get_filename_component (base_name "${base}" NAME) - set (command_base ${GLIB_GENMARSHAL_EXECUTABLE} - --prefix ${prefix} "${base_name}.list") - - # On Windows, the final makefile may contain: - # cd e:\abc && ... - # That won't actually change the directory. We have to do: - # cd e:\abc && e: && ... - if (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]") - string (SUBSTRING "${base_path}" 0 2 base_drive) - set (command_base "${base_drive}" && "${command_base}") - endif (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]") - - # NOTE: VERBATIM would cause problems, so it is not used here - add_custom_command (OUTPUT ${base}.c - COMMAND ${command_base} --body > "${base_name}.c" - DEPENDS "${base}.list" - WORKING_DIRECTORY "${base_path}" - COMMENT "Generating marshallers source file") - add_custom_command (OUTPUT ${base}.h - COMMAND ${command_base} --header > "${base_name}.h" - DEPENDS "${base}.list" - WORKING_DIRECTORY "${base_path}" - COMMENT "Generating marshallers header file") - else (GLIB_GENMARSHAL_EXECUTABLE) - message (WARNING "glib-genmarshal is not present on this system") - endif (GLIB_GENMARSHAL_EXECUTABLE) + get_filename_component (base_path "${base}" PATH) + get_filename_component (base_name "${base}" NAME) + set (command_base ${GLIB_GENMARSHAL_EXECUTABLE} + --prefix ${prefix} "${base_name}.list") + + # On Windows, the final makefile may contain: + # cd e:\abc && ... + # That won't actually change the directory. We have to do: + # cd e:\abc && e: && ... + if (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]") + string (SUBSTRING "${base_path}" 0 2 base_drive) + set (command_base "${base_drive}" && "${command_base}") + endif (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]") + + # NOTE: VERBATIM would cause problems, so it is not used here + add_custom_command (OUTPUT ${base}.c + COMMAND ${command_base} --body > "${base_name}.c" + DEPENDS "${base}.list" + WORKING_DIRECTORY "${base_path}" + COMMENT "Generating marshallers source file") + add_custom_command (OUTPUT ${base}.h + COMMAND ${command_base} --header > "${base_name}.h" + DEPENDS "${base}.list" + WORKING_DIRECTORY "${base_path}" + COMMENT "Generating marshallers header file") endfunction (glib_genmarshal) glib_genmarshal (${CMAKE_CURRENT_SOURCE_DIR}/liblogdiag/ld-marshal @@ -283,7 +282,7 @@ set (CPACK_NSIS_DELETE_ICONS_EXTRA Delete '\$SMPROGRAMS\\\\$SM_FOLDER\\\\logdiag.lnk'") set (CPACK_SOURCE_GENERATOR "TGZ;ZIP") -set (CPACK_SOURCE_IGNORE_FILES "/build;/.svn;/.git;/win32-depends") +set (CPACK_SOURCE_IGNORE_FILES "/.git;/build;/win32-depends;/liblogdiag/ld-marshal.[ch]") set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") -- cgit v1.2.3