+++ /dev/null
-
-
-if (NOT SOURCE_DIRECTORY)
- message (FATAL_ERROR "SOURCE_DIRECTORY must be defined")
-
-else()
- set (link_dir "${SOURCE_DIRECTORY}/tmp")
- execute_process ( COMMAND ${CMAKE_COMMAND} -E make_directory "${link_dir}")
-
-
- file (GLOB ALL_FILES RELATIVE ${SOURCE_DIRECTORY} "*")
-
- foreach (f ${ALL_FILES})
- if ( IS_SYMLINK ${f} )
-
- # This two step copy process is necessary to ensure the binary
- # is copied rather than the symlink. So, the first 'copy'
- # command ensure the binary has a newer timestamp than
- # the symlink (cmake won't copy if the two files have
- # the same timestamp). The second copy will overwrite
- # the original symlink.
-
- execute_process ( COMMAND ${CMAKE_COMMAND} -E copy "${f}" "${link_dir}/${f}" )
- execute_process ( COMMAND ${CMAKE_COMMAND} -E copy "${link_dir}/${f}" "${f}" )
- endif ( IS_SYMLINK ${f} )
- endforeach(f)
-
- execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory "${link_dir}")
-endif()
COMMENT "recreating autotools symlinks"
)
-add_custom_target( copy_symlinks
- COMMAND
- ${CMAKE_COMMAND} -DSOURCE_DIRECTORY=${CMAKE_SOURCE_DIR}
- -P ${CMAKE_CURRENT_LIST_DIR}/copy_symlinks.cmake
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- COMMENT "converting top level symlinks to binaries"
-)
-
-add_custom_target( copy_m4_symlinks
- COMMAND
- ${CMAKE_COMMAND}
- -DSOURCE_DIRECTORY=${CMAKE_SOURCE_DIR}/m4
- -P ${CMAKE_CURRENT_LIST_DIR}/copy_symlinks.cmake
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/m4
- COMMENT "converting m4 symlinks to binaries"
-)
-
add_custom_target( dist
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target copy_manuals_to_source
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target autotools_binaries
-# COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target copy_symlinks
-# COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target copy_m4_symlinks
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package_source
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target delete_manuals_in_source
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target autotools_symlinks # recreate autotool links.