[CMake] advice for resolving errors with CMake 3.8

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 2 18:55:34 EDT 2018


On 2018-05-02 09:45-0700 Michael Ellery wrote:

> I generally develop on a latest cmake (provided by homebrew) and that works well for me. Unfortunately, I also need to support Visual Studio builds and it looks like the cmake that is bundled with VS is 3.8. I’m apparently using bleeding-edge features related to IMPORTED libraries, judging by these errors:
>
> ||   Cannot specify include directories for imported target “some_lib”.
>
> ||   add_library cannot create ALIAS target “NIH::some_lib" because target
> ||   “some_lib" is IMPORTED.
>
> ||   Cannot specify compile options for imported target “some_lib".
> ||
>
> What is the recommended way to deal with include dirs and compile settings for IMPORTED targets with pre-3.11?

Hi Michael:

Just in case nobody comes up with a simple solution for your question
about taking the backward step (in my opinion) of making your build
system compatible with CMake-3.8, have you tried to download and
install CMake version 3.11 from KitWare for Windows to see if that
works well for your VS platform?  (My guess is you would merely need
to change the PATH so that CMake version 3.11 rather than CMake
version 3.8 was used, but I don't have any VS experience so it might
be more complicated than that.) Anyhow, I thought this idea was worth
a shot since it allows you to stick with CMake-3.11 compatibility for
your build system.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

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.sf.net); 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