Hi Ben, again thank you for your replies…
Yes, I am using the cmake’s FindGLEW.cmake… And the setting GLEW_LIBRARIES absolutely depends on whether a glew-config.cmake, etc, is found, or not… if I move these files away, or point to a GLEW installation with no such cmake CONFIG files, then GLEW_LIBRARIES is correctly defined…
Now this project, fgpanel
is part of a much larger project, flightgear
, and actually has a considerable number of 3rdParty
dependencies, like PNG, ZLIB, OpenGL, Freetype, GLUT, … and this missing GLEW_LIBRARIES
is the only one causing a LINK problem. But experimenting, making trial changes, in such a big project is very slow and time consuming…
But I have now been able to separate this source, into a single project… where testing, trials, changes, … is much easier, and faster…
And now note GLEW_INCLUDE_DIRS is also not defined! This was being masked by other dependencies already defining the required target_include_directories(…), of X:\3rdParty.x64\include
, so did not note it being blank…
And now I see I last built, and installed, this GLEW was back in Feb 2018, so this would have been with a much older cmake version, than my current 3.16.4.
Could it be that maybe these GLEW cmake CONFIG files were mal-formed, or incomplete? I will try to recompile GLEW, probably a later version, and do a new install… to see if that does anything… but this will take a few days, maybe a week, or so… unfortunately…
Now, each time you have mentioned using the imported target
, and we could adjust to that, but how do you detect that such aliases, if that is what they are called, do exist? Are available?
In a quick check, it seems if (GLEW::GLEW)
or if (GLEW::glew)
both FAIL! It seems if (GLEW_DIR)
does work, but seems odd, strange…
Simply, what is the approved method to signal the use of imported target
?
A brief review of the some 160 FindXXXX.cmake
in the gitlab.kitware repo, as of Apr 10, 2020, shows some, like RTI, OpenAL, … maybe more, that do not seem to yet set imported target
… so it is certainly not 100%, yet…
And to again stress the point, here is what is defined by FindGLEW.cmake, if the glew-config.cmake
files are NOT present -
-- === GLEW_CONSIDERED_CONFIGS=
-- === GLEW_CONSIDERED_VERSIONS=
-- === GLEW_DIR=GLEW_DIR-NOTFOUND
-- === GLEW_FOUND=TRUE
-- === GLEW_INCLUDE_DIR=X:/3rdParty.x64/include
-- === GLEW_INCLUDE_DIRS=X:/3rdParty.x64/include
-- === GLEW_LIBRARIES=optimized;X:/3rdParty.x64/lib/glew32.lib;debug;X:/3rdParty.x64/lib/glew32d.lib
-- === GLEW_SHARED_FOUND=TRUE
-- === GLEW_SHARED_LIBRARIES=optimized;X:/3rdParty.x64/lib/glew32.lib;debug;X:/3rdParty.x64/lib/glew32d.lib
-- === GLEW_SHARED_LIBRARY=optimized;X:/3rdParty.x64/lib/glew32.lib;debug;X:/3rdParty.x64/lib/glew32d.lib
-- === GLEW_SHARED_LIBRARY_DEBUG=X:/3rdParty.x64/lib/glew32d.lib
-- === GLEW_SHARED_LIBRARY_RELEASE=X:/3rdParty.x64/lib/glew32.lib
-- === GLEW_STATIC_FOUND=TRUE
-- === GLEW_STATIC_LIBRARIES=X:/3rdParty.x64/lib/glew32s.lib
-- === GLEW_STATIC_LIBRARY=X:/3rdParty.x64/lib/glew32s.lib
-- === GLEW_STATIC_LIBRARY_DEBUG=GLEW_STATIC_LIBRARY_DEBUG-NOTFOUND
-- === GLEW_STATIC_LIBRARY_RELEASE=X:/3rdParty.x64/lib/glew32s.lib
-- === GLEW_VERSION=2.1.0
-- === GLEW_VERSION_MAJOR=2
-- === GLEW_VERSION_MICRO=0
-- === GLEW_VERSION_MINOR=1
And when glew-config.cmake, et al
is present -
-- === GLEW_CONFIG=X:/3rdParty.x64/lib/cmake/glew/glew-config.cmake
-- === GLEW_CONSIDERED_CONFIGS=X:/3rdParty.x64/lib/cmake/glew/glew-config.cmake
-- === GLEW_CONSIDERED_VERSIONS=unknown
-- === GLEW_DIR=X:/3rdParty.x64/lib/cmake/glew
-- === GLEW_FOUND=TRUE
-- === GLEW_VERSION_COUNT=0
-- === GLEW_VERSION_MAJOR=0
-- === GLEW_VERSION_MINOR=0
-- === GLEW_VERSION_PATCH=0
-- === GLEW_VERSION_TWEAK=0
Chaulk and cheese ;=))
This is done through get_cmake_property(_variableNames VARIABLES)
, then outputing in a foreach
… Maybe there is a better way, to get a more complete list… appreciate any help on that…
As stated, will get around to re-building and installing GLEW, to see if that changes anything…
And if not will try to get around to filing an issue…
But meantime, hope someone can help with detecting imported target
… thanks…