View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014381CMakeCMakepublic2013-08-29 03:522014-10-06 10:32
ReporterJussiP 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformanyOSanyOS Versionany
Product VersionCMake 2.8.11 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0014381: Inconsistent behaviour between find_package and pkg_check_modules
DescriptionFind_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 ReproduceRun 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.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035482)
Brad King (manager)
2014-03-24 09:08

A patch to address this has been applied here:

 FindPkgConfig: Stop processing when REQUIRED package not found
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63a4c0af [^]
(0036951)
Robert Maynard (manager)
2014-10-06 10:32

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-08-29 03:52 JussiP New Issue
2014-03-24 09:08 Brad King Note Added: 0035482
2014-03-24 09:08 Brad King Assigned To => Brad King
2014-03-24 09:08 Brad King Status new => resolved
2014-03-24 09:08 Brad King Resolution open => fixed
2014-03-24 09:08 Brad King Fixed in Version => CMake 3.1
2014-03-24 09:08 Brad King Target Version => CMake 3.1
2014-10-06 10:32 Robert Maynard Note Added: 0036951
2014-10-06 10:32 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team