[Dune-devel] [Dune-Commit] [Commit] dune-common - 3824de8: Fix dune_symlink_to_source_tree for cmake 3.1

Markus Blatt markus at dr-blatt.de
Wed Apr 1 17:48:56 CEST 2015


Hi Dominic,

I must admit that I do not understand what the patch does. But it
smells a bit fishy (maybe that is because I am not totally aware what
the symlink stuff did before, though).

Could you explain what the resulting code now does?

More comments below:

On Wed, Apr 01, 2015 at 03:22:47PM +0200, Dominic Kempf wrote:
> New commit, appeared at Wed Apr  1 15:22:47 2015 +0200
> as part of the following ref changes:
> 
>     branch refs/heads/master    updated from 68e8bde -> 0154ec0
> 
> Browsable version: http://cgit.dune-project.org/repositories/dune-common/commit/?id=3824de87c29973dbf4cc19e5f85fb37100a4fe65
> 
> ======================================================================
> 
> commit 3824de87c29973dbf4cc19e5f85fb37100a4fe65
> Author: Dominic Kempf <dominic.r.kempf at gmail.com>
> Date:   Wed Apr 1 15:12:42 2015 +0200
> 
>     Fix dune_symlink_to_source_tree for cmake 3.1
>     
>     CMake 3.1 issued a lot of warnings because it tried to symlink:
>     - git specific subdirs that are not present in the build tree
>     - build directories that are a subdir of the source instead of a sibling
>     
>     The change
>     - adds a symlink iff a CMakeLists file was found in the source dir.
>     - excludes such build directory.
> 
>  cmake/modules/DuneSymlinkOrCopy.cmake | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> 
> 
> diff --git a/cmake/modules/DuneSymlinkOrCopy.cmake b/cmake/modules/DuneSymlinkOrCopy.cmake
> index 99595c8..fee4046 100644
> --- a/cmake/modules/DuneSymlinkOrCopy.cmake
> +++ b/cmake/modules/DuneSymlinkOrCopy.cmake
> @@ -72,12 +72,14 @@ macro(dune_symlink_to_source_tree)
>      endif()
>    else()
>      # get a list of all files in the current source directory and below.
> -    file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} "*")
> +    file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} ".*CMakeLists.txt")

This is how this looks to me: Previously all file below
${CMAKE_SOURCE_DIR} were in the files variable. Now it is only the
CMakeLists.txt. Does really make sense?

>  
>      # iterate over all files, extract the directory name and write a symlink in the corresponding build directory
> -    foreach(f ${files})
> +    foreach(f ${files} "./")
>        get_filename_component(dir ${f} DIRECTORY)
> -      execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/${dir}" "${CMAKE_BINARY_DIR}/${dir}/src_dir")
> +      if(NOT dir MATCHES "${CMAKE_BINARY_DIR}/*")
> +        execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/${dir}" "${CMAKE_BINARY_DIR}/${dir}/src_dir")
> +      endif(NOT dir MATCHES "${CMAKE_BINARY_DIR}/*")

Ok, you skip the binary. That makes sense. But you now link the
currect CMAKE_SOURCE_DIR and the CMakeLists.txt files below it.

>      endforeach()
>    endif()
>  endmacro(dune_symlink_to_source_tree)

BTW: Sorry for the noise if I am just to dense to get it.

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150401/8648f360/attachment.sig>


More information about the Dune-devel mailing list