[CMake] Plan to deal with remaining D language support issues for PLplot

Alan W. Irwin Alan.W.Irwin1234 at gmail.com
Wed Aug 21 16:37:07 EDT 2019


Hi Ben:

You know this already from our off-list discussion, but for other's here,
the PLplot's ancient fork of the cmaked project works well for gdc, but is completely
broken (doesn't even compile a test example) with dmd on my Linux (Debian Buster)
platform.  So I have been trying the
[cmake-d](https://github.com/dcarp/cmake-d) project (suitably patched for
PLplot needs) instead for our D language support.  That support
currently works well for gdc, and also *almost* works well for dmd
(and probably ldc as well although I am concentrating on the dmd case
at the moment).

The remaining issues for cmake-d appear to be

1.

# "D" version:
set(CMAKE_LIBRARY_PATH_FLAG "-L-L")
set(CMAKE_LINK_LIBRARY_FLAG "-L-l")

for the dmd and also the ldc cases.

This conflicts with support for our other languages on Linux which sets

# "C" version
set(CMAKE_LIBRARY_PATH_FLAG "-L")
set(CMAKE_LINK_LIBRARY_FLAG "-l")

2. Libraries linked by full pathname cannot be linked properly by dmd and lcd
(since they both need an "-L" prefix to such pathnames to pass those to the linker).

I took a look at [another D support project that you recommended to me
off list](https://github.com/trentforkert/cmake/) that project
contained the following commit:

Author: Ben Boeckel <mathstuf at gmail.com>
Date:   Tue Apr 15 00:21:15 2014 -0400

     linking: Support language-specific link flags

     Adds support for the following variables:

       * CMAKE_<LANG>_LINK_LIBRARY_FLAG
       * CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG
       * CMAKE_<LANG>_LINK_LIBRARY_SUFFIX
       * CMAKE_<LANG>_LINK_PATH_FLAG
       * CMAKE_<LANG>_LINK_PATH_TERMINATOR

     so that compilers with different flags can be used in the same build.

M       Help/manual/cmake-variables.7.rst
A       Help/variable/CMAKE_LANG_LIBRARY_PATH_FLAG.rst
A       Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst
A       Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
A       Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst
M       Source/cmComputeLinkInformation.cxx
M       Source/cmLocalGenerator.cxx

It appears from those documentation files that this commit would help
to solve both issues 1. and 2. above.  Therefore, my planned next step
is to rebase that commit on the upstream cmake master branch, and test
that patched upstream result to see if those limited internal CMake
changes allow fixing (with minor patching of cmake-d files) all
remaining cmake-d issues for the PLplot use case.

More later as the above plan unfolds....

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.org); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list