mirror of https://github.com/CGAL/cgal
replace $URL$ and $Id$ when generating a release
This commit is contained in:
parent
76a543fd3b
commit
eda6d41e8f
|
|
@ -12,11 +12,14 @@ file(READ "${CMAKE_BINARY_DIR}/Installation/include/CGAL/version.h" version_file
|
||||||
string(REGEX MATCH "define CGAL_VERSION (.*)\n#define CGAL_VERSION_NR" CGAL_VERSION_FOUND "${version_file_content}")
|
string(REGEX MATCH "define CGAL_VERSION (.*)\n#define CGAL_VERSION_NR" CGAL_VERSION_FOUND "${version_file_content}")
|
||||||
|
|
||||||
if (CGAL_VERSION_FOUND)
|
if (CGAL_VERSION_FOUND)
|
||||||
SET(CGAL_VERSION "${CMAKE_MATCH_1}")
|
set(CGAL_VERSION "${CMAKE_MATCH_1}")
|
||||||
|
set (GITHUB_PREFIX "https://github.com/CGAL/cgal/blob/releases/CGAL-${CGAL_VERSION}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Cannot extract CGAL version number.")
|
message(FATAL_ERROR "Cannot extract CGAL version number.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (NOT DEFINED DESTINATION)
|
if (NOT DEFINED DESTINATION)
|
||||||
SET(DESTINATION "/tmp")
|
SET(DESTINATION "/tmp")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -61,9 +64,18 @@ foreach(pkg ${files})
|
||||||
if(NOT IS_DIRECTORY ${release_dir}/${afile_dir})
|
if(NOT IS_DIRECTORY ${release_dir}/${afile_dir})
|
||||||
file(MAKE_DIRECTORY ${release_dir}/${afile_dir})
|
file(MAKE_DIRECTORY ${release_dir}/${afile_dir})
|
||||||
endif()
|
endif()
|
||||||
#copy the file
|
|
||||||
|
#copy the file (replace $URL$ and $ID$ for *.h and *.hpp)
|
||||||
|
get_filename_component(fext ${fname} EXT)
|
||||||
|
if ("${fext}" STREQUAL ".h" OR "${fext}" STREQUAL ".hpp")
|
||||||
|
file(READ "${pkg_dir}/${f}" file_content)
|
||||||
|
string(REPLACE "$URL$" "${GITHUB_PREFIX}/${pkg}/${f}" file_content ${file_content})
|
||||||
|
string(REPLACE "$Id$" "This file is from the release ${CGAL_VERSION} of CGAL" file_content ${file_content})
|
||||||
|
file(WRITE ${release_dir}/${afile_dir}/${fname} ${file_content})
|
||||||
|
else()
|
||||||
file(COPY ${afile} DESTINATION ${release_dir}/${afile_dir})
|
file(COPY ${afile} DESTINATION ${release_dir}/${afile_dir})
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue