Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.74k stars 820 forks source link

CMake warnings around CPM, nlopt, ... #3900

Open gzotti opened 1 month ago

gzotti commented 1 month ago

Expected Behaviour

CMake sets up the project without warnings

Actual Behaviour

CMake reports various warnings. (Where) Can these be mitigated, or should it be reported to nlopt ?

-- Found CMake 3.24.2 -- Platform: Windows-10.0.22631 (AMD64) -- Found Git 2.46.0.windows.1 -- Building Stellarium 24.2+ (v24.2.261; Mode: Release) -- Found Stellarium User Guide -- Found Qt6: C:/Qt/6.5.3/msvc2019_64/bin/qmake.exe (found suitable version 6.5.3) -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) -- Building an OpenGL/OpenGL ES build -- CPM: Using local package ShowMySky-Qt6@ -- Found ShowMySky library: D:/StelDev/GIT/build-stellarium-Desktop_Qt_6_5_3_MSVC2019_64bit-Release/_deps/showmysky-qt6-build/ShowMySky/ShowMySky-Qt6.dll -- GPS: support by Qt's NMEA handling enabled. -- Unit tests support: disabled -- Using bundled zlib version at D:/StelDev/GIT/stellarium/src/external/zlib -- Using bundled qtcompress at D:/StelDev/GIT/stellarium/src/external/qtcompress -- Found windeployqt: C:/Qt/6.5.3/msvc2019_64/bin/windeployqt.exe -- Found Spout library: D:/StelDev/GIT/stellarium/util/spout2/x64/SpoutLibrary.dll -- Could NOT find Inno Setup compiler. You won't be able to build setup files. -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Checking that std::from_chars for floats is supported by the C++ library -- Checking that std::from_chars for floats is supported by the C++ library - yes -- Checking that std::execution::par is supported by the C++ library -- Checking that std::execution::par is supported by the C++ library - yes -- CPM: Adding package indiclient@1.8.5 (1.8.5) CMake Warning at plugins/LensDistortionEstimator/src/CMakeLists.txt:1 (FIND_PACKAGE): By not providing "Findexiv2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "exiv2", but CMake did not find one.

Could not find a package configuration file provided by "exiv2" with any of the following names:

exiv2Config.cmake
exiv2-config.cmake

Add the installation prefix of "exiv2" to CMAKE_PREFIX_PATH or set "exiv2_DIR" to a directory containing one of the above files. If "exiv2" provides a separate development package or SDK, be sure it has been installed.

-- CPM: Adding package NLopt@2.7.1 (2.7.1) -- NLopt version 2.7.1 CMake Warning at C:/Qt/Tools/CMake_64/share/cmake-3.24/Modules/CPack.cmake:478 (message): CPack.cmake has already been included!! Call Stack (most recent call first): D:/StelDev/GIT/build-stellarium-Desktop_Qt_6_5_3_MSVC2019_64bit-Release/_deps/nlopt-src/CMakeLists.txt:353 (include)

-- Found lupdate: C:/Qt/6.5.3/msvc2019_64/bin/lupdate.exe -- Found lconvert: C:/Qt/6.5.3/msvc2019_64/bin/lconvert.exe -- Configuring done CMake Warning (dev) in D:/StelDev/GIT/build-stellarium-Desktop_Qt_6_5_3_MSVC2019_64bit-Release/_deps/nlopt-src/CMakeLists.txt: Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files. Run "cmake --help-policy CMP0071" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

For compatibility, CMake is excluding the GENERATED source file(s):

"D:/StelDev/GIT/build-stellarium-Desktop_Qt_6_5_3_MSVC2019_64bit-Release/_deps/nlopt-build/nlopt.hpp"

from processing by AUTOMOC and AUTOUIC. If any of the files should be processed, set CMP0071 to NEW. If any of the files should not be processed, explicitly exclude them by setting the source file property SKIP_AUTOGEN:

set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done -- Build files have been written to: D:/StelDev/GIT/build-stellarium-Desktop_Qt_6_5_3_MSVC2019_64bit-Release

Steps to reproduce

Run cmake on master

System

10110111 commented 1 month ago

The policy can be set in our CMakeLists. And the repeated inclusion of CPack I suppose needs a special support from the NLopt (e.g. an option to disable it, so that the package is more easily usable with CPM).

alex-w commented 1 month ago

Hmm… but we set policy CMP0071 in our cmake file already…

alex-w commented 1 month ago

@10110111 what about adding an option QUIET for FIND_PACKAGE(exiv2) - is it acceptable for you?

10110111 commented 1 month ago

what about adding an option QUIET for FIND_PACKAGE(exiv2) - is it acceptable for you?

No, lacking exiv2 implies lacking a piece of functionality of the plugin. It's better to be vocal about this.

gzotti commented 1 month ago

Hmm… but we set policy CMP0071 in our cmake file already…

As I understand this is in one of CPM's packages, so not sure if we should patch this or report an issue upstream.

alex-w commented 1 month ago

what about adding an option QUIET for FIND_PACKAGE(exiv2) - is it acceptable for you?

No, lacking exiv2 implies lacking a piece of functionality of the plugin. It's better to be vocal about this.

Please check branch cmake-exiv2

alex-w commented 1 month ago

A small addition: adding ShowMySky via CPM generates warnings for cmake policy too

10110111 commented 1 month ago

Please check branch cmake-exiv2

No, this still doesn't stand out well enough. Missing desired library is an ugly situation, it should be reflected by an ugly message, as it is now in master.

As I understand this is in one of CPM's packages, so not sure if we should patch this or report an issue upstream.

Surely generally it's a thing for upstream to solve. I just thought CMake would let our choice be inherited by CMakeLists included... Anyway, I don't expect it to get into the nearest Stellarium release, even if the maintainers do apply the patch immediately (unless you want to refer to unreleased revisions).