Hi

I'm converting a big project (SWI-Prolog) to cmake. Still a newbie wrt.
cmake, but quite happy. There is one thing that I can't get done:
install the system using symbolic links to the source tree. This is in
this case really handy for developers.

I've come as far as understanding:

  - The generator creates cmake_install.cmake
  - make/ninja/... install calls cmake -P cmake_install.cmake
  - This calls file(INSTALL ....)

So, I thought I can

  - Add a file cmake_ln_install.cmake that
    - redefines file()
    - includes cmake_install.cmake

To redefine file(), I tried this to see whether this works:

function(file)
  message("Calling file(${ARGN})")
  _file(${ARGN})
endfunction()

But ... some of the file() calls contain empty strings ("") in the
argument vector.  All the rest works fine.

On stack overflow [1], the suggestion was to use "${ARGN}", which
indeed keeps the empty lists and works fine if the receiver is a
function iterating over its argument vector.  After downloading
the cmake source it turns out file() is builtin (C++) and complains
to require at least 2 arguments.  I tried passing the first two
as file(${arg1} ${arg2} "${ARGN}"), which would (I think) work for
a user function, but doesn't for a builtin.

So, my question is

  - Is there a way to redefine a builtin function that passes
    empty strings correctly to the original?
  - If not, should this be considered a bug ...

        Thanks --- Jan

P.s.    I'd also like to see the possibility to create symlinks
        in cmake, other than calling cmake -E ...

[1] https://stackoverflow.com/questions/52480737/pass-empty-strings-in-cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to