Skip to content
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: Warn (or error) about missing dependency #956

wants to merge 2 commits into from


Copy link

commented Apr 19, 2017

With this change, when an dependency can't be build because it is missing something, it prints out an message (Couldn't find NAME! or Couldn't find NAME! Required for THING.).

If STRICT is set to ON, it'll send an error, kinda like other projects. It won't abort the process so the user can see further errors (but they won't be able to build). By default, it is set to OFF so existing builders won't break.

Also, an function not_found_msg is introduced for printing the message and determining whenever it should send an error. It is declared in the main CMakeLists.txt because it is small, but I'm unsure if it should go to an module.

This probably needs some more testing. I hope I covered all cases.

CMake: Warn about missing dependency
When an feature has been enabled but the dependency hasn't been
fulfilled, it now prints an warning. Please note that the minimum
version is CMake 2.4, but the message(WARNING ...) has been introduced
to CMake 2.8.

Also, there's the option STRICT, that lets the generation fail on such
error. This is OFF by default to not to break existing builders.
@@ -75,6 +79,8 @@ if(ENABLE_CHARSET)
# Check for iconv support.
not_found_msg("iconvi" "charset support")

This comment has been minimized.

Copy link

arza-zara Apr 20, 2017


last "i" a typo?

@@ -220,6 +239,8 @@ find_package(CppUTest)
not_found_msg("CppUTest" "testing")

This comment has been minimized.

Copy link

arza-zara Apr 20, 2017


rather "compiling unit tests"


This comment has been minimized.

Copy link

commented Apr 20, 2017

Closes #916.

@Neui Neui force-pushed the Neui:cmake-strict branch from 9a6275c to 11d1089 Apr 20, 2017


This comment has been minimized.

Copy link

commented Sep 15, 2019

Done, with a slightly different implementation.

flashcode added a commit that referenced this pull request Sep 15, 2019
core: remove obsolete file FindTCL.cmake (issue #916, issue #956)
This is file is provided by CMake and is not needed any more.  Moreover, it
causes an error on FreeBSD (TCL not found), even if TCL was properly detected
and used during the build.
flashcode added a commit that referenced this pull request Sep 16, 2019
debian: fix build of packages on Debian Jessie (issue #916, issue #956)
With the new errors on missing libraries in CMake, the PHP plugin must be
explicitly disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.