FLTK logo

Re: [fltk/fltk] Cannot build project with CMake (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) (Issue #970)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Cannot build project with CMake (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) (Issue #970) Albrecht Schlosser 03:57 May 09  
 

Actually, I have a strong preference against setting the FLTK_DIR path in the project's CMakeLists.txt file, because I find it better that this file be agnostic as to where FLTK is installed

That's fine, as long as you set it as a cache variable on the commandline in the first CMake invocation. Our original recommendation to set it as a simple (non-cache) CMake variable is not recommended. If it's set as a cache variable you can inspect it after the build which is very helpful if there are any doubts (as in this case).

Hint: If you don't need the system installation of FLTK I recommend to remove it just to be sure it doesn't affect the build. There are well-known issues when mixing header and binary files of self-built and system versions. However, that is only relevant later, at runtime.

I believe that the problem lies with CMake version. The version I use in this computer is 1.16 3.16, which should be fine according to README.CMake.txt ... what version of CMake are you using?

[Typo 1.16 fixed in citation, must be 3.16] For my regular builds I'm using 3.25.1 (Debian Bookworm default), and that's what I used in my tests of your project. However, I have 6 older and newer versions present as well: from 3.15.0 (currently our minimum required version) up to 3.28.1 on my Debian system and even 3.29.2 on my Windows system where I have also several installed versions I can select. It is not impossible that a particular CMake version has a certain kind of bug that's fixed later. I know of some issues that have or have not been fixed in later versions.

That said, I can test your project with CMake 3.15.0 and 3.18.0, the oldest versions I have presently available. Let's see if I can reproduce your issue, but I'd appreciate if you could test with other CMake versions as well. TIA.

Maybe the issue could just be solved by upgrading the CMake minimum requirement?

I would like to stay conservative (i.e. keep 3.15) as long as possible (in FLTK 1.4.x). FLTK 1.5 will probably require a higher version. If I can reproduce the issue with one of my older versions there are chances I can work around the issue on the FLTK side.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/970/2102439601@github.com>

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.