The FindGLEW.cmake module does not set GLEW_LIBRARIES in some cases

Again, thanks for the further feedback…

That is exactly what I tried to do - that is add code before the return(), to add the missing variable, but the question was how to use just the information from the config modules…

One is maybe ok, like GLEW_LIBRARIES, which you could set to GLEW::GLEW, or GLEW::glew, and cmake would later expand that to a <path>/library… but as previously requested, still seek a way to output the full path, for diagnostic purposes…

And can NOT find any way to set GLEW_INCLUDE_DIRS, or the GLEW_VERSION_XXXX variables… without doing what is done later, if the CONFIG is not found…

Namely find_path(GLEW_INCLUDE_DIR GL/glew.h), then file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" _contents REGEX "^VERSION_.+ [0-9]+"), etc, etc…that path and version information just does NOT exist in the CONFIG files…

I went back and re-read the tutorial… wow, it has certainly expanded in the intervening years… copied and built the complete tutorial… even found what I think is a small BUG in the MathFunctions/CMakeLists.txt… my small diff -

diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
index c911625b80..e7751d40fd 100644
--- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
@@ -58,6 +58,8 @@ set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
 
 # install rules
 install(TARGETS MathFunctions tutorial_compiler_flags
-        DESTINATION lib
-        EXPORT MathFunctionsTargets)
+        EXPORT MathFunctionsTargets
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib)
 install(FILES MathFunctions.h DESTINATION include)

In windows at least, a DLL should be installed to the bin directory, not ALL to the lib folder… but that is off topic…

And then I built a small test-tut app, to use the MathFunctions.dll, and a FindMathFunctions.cmake, based on FindGLEW.cmake, and it too FAILED… so did a lot of experimenting with it… lots of insertions before the return() ;=)) did achieve some very kludgy successes…

Anyway, I am running out of ideas, and steam, without further information, so will try to get around to filing an issue… if someone does not beat me to it…

Thanks for all your help… I have learned a lot along the way… but seemingly still not enought about TARGETs… especially about why it seems this in the new, preferred? way forward…

And have now come across some other projects that are having problems with TARGET vs variables, usually after a cmake version upgrade… but they are trying to adjust…

I know, it takes time to get all the documentation, information, examples, etc, in place… in the open s/w voluntary world… so will be patient…