New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: Silence warnings. #9071
cmake: Silence warnings. #9071
Conversation
| @@ -485,8 +485,8 @@ if(OPROFILING) | |||
| endif() | |||
|
|
|||
| if(ENABLE_EVDEV) | |||
| find_package(Libudev REQUIRED) | |||
| find_package(Libevdev REQUIRED) | |||
| find_package(LIBUDEV REQUIRED) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really for this review but just surprised we use if(LIBUDEV_FOUND...) when we specify REQURIED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like you said, that is out of scope for this PR, but it should probably be fixed later... It might be possible to make them entirely optional?
$ find . -type f -iname '*cmake*' | xargs grep -e LIBUDEV_FOUND -e LIBEVDEV_FOUND
./Externals/libusb/CMakeLists.txt: if(LIBUDEV_FOUND)
./Externals/hidapi/CMakeLists.txt: if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LIBUDEV_FOUND)
./Source/Core/InputCommon/CMakeLists.txt:if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
./CMake/FindLIBEVDEV.cmake:# LIBEVDEV_FOUND - System has libevdev
./CMake/FindLIBUDEV.cmake:# LIBUDEV_FOUND - System has LIBUDEV
./CMakeLists.txt: if(LIBUDEV_FOUND AND LIBEVDEV_FOUND)
Silences many warnings with newer cmake versions, tested with
cmake-3.18.2.There are two issues.
find_package(Foo)which callsFindFoo.cmakeand includes manyFOO_variables. It should use one name consistently. For examplefind_package(FOO),FindFOO.cmakeandFOO_FOUND.find_package(PkgConfig)instead ofinclude(FindPkgConfig), most of the cmake files in dolphin already do this and upstream cmake also does this in their own modules.Examples:
Full log: dolphin.log