The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=14381 ====================================================================== Reported By: JussiP Assigned To: ====================================================================== Project: CMake Issue ID: 14381 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2013-08-29 03:52 EDT Last Modified: 2013-08-29 03:52 EDT ====================================================================== Summary: Inconsistent behaviour between find_package and pkg_check_modules Description: Find_package and pkg_check_modules behave differently with regard to the REQUIRED keyword. Find_package halts immediately with an error, but pkg_check_modules does not.
The entire point of REQUIRED is to halt the configuration if something can't be found. Having the user check the return code by themselves is equivalent to not having the REQUIRED keyword at all. Please change the behaviour of pkg_check_modules to exit on error when REQUIRED is defined. Steps to Reproduce: Run this: --- project(depdemo C) cmake_minimum_required(VERSION 2.8.1) find_package(PkgConfig REQUIRED) pkg_check_modules(DEPS REQUIRED notexisting) message(STATUS "This should never be printed.") --- The message text is printed even though it should not be. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2013-08-29 03:52 JussiP New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers