View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014630CMakeCMakepublic2013-12-04 06:292014-06-02 08:39
Reporterbreese 
Assigned ToRolf Eike Beer 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionunable to reproduce 
PlatformUbuntuOSLinuxOS Version3.11.0-14
Product VersionCMake 2.8.11.2 
Target VersionFixed in Version 
Summary0014630: FindBZip2 finds bzip2 without header file
DescriptionThe bzip2 package contains the libraries, but not the header files. The header files are located in the libbz2-dev package. If you only have installed the bzip2 package, but not the libbz2-dev package, FindBZip2 will report bzip2 as found and provide the include directory.

The problem is due to an incorrect use of FIND_PACKAGE_HANDLE_STANDARD_ARGS(), which is missing the DEFAULT_MSG argument. The attached patch fixes the problem.
TagsNo tags attached.
Attached Filesdiff file icon FindBZip2.diff [^] (594 bytes) 2013-12-04 06:30 [Show Content]
diff file icon FindBZip2-b.diff [^] (612 bytes) 2013-12-05 03:13 [Show Content]

 Relationships

  Notes
(0034707)
Brad King (manager)
2013-12-04 08:23

Applied, thanks!

FindBZip2: Require header to be found
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6d073a9 [^]
(0034710)
Brad King (manager)
2013-12-04 11:20

Eike pointed out that the proposed patch mixes the FPHSA signatures. Reverting for now:

 Revert "FindBZip2: Require header to be found"
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93c2734e [^]
(0034718)
breese (reporter)
2013-12-05 03:12

Is the second patch (FindBZip2-b.diff) better?
(0034721)
Brad King (manager)
2013-12-05 11:00

Actually the current FPHSA call looks correct and is the same as in many other modules.

I cannot even reproduce the reported issue:

$ apt-cache policy bzip2
bzip2:
  Installed: 1.0.6-5
  Candidate: 1.0.6-5

$ apt-cache policy libbz2-dev
libbz2-dev:
  Installed: (none)
  Candidate: 1.0.6-5

$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
project(Issue14630 C)
find_package(BZip2)
foreach(v BZIP2_FOUND BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
  message(STATUS "${v}=[${${v}}]")
endforeach()

$ cmake --version
cmake version 2.8.12.1

$ cmake ..
...
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- BZIP2_FOUND=[FALSE]
-- BZIP2_LIBRARIES=[BZIP2_LIBRARY-NOTFOUND]
-- BZIP2_INCLUDE_DIR=[BZIP2_INCLUDE_DIR-NOTFOUND]
...

Even if I fake the library location it still fails on the headers:

$ cmake .. -DBZIP2_LIBRARY_RELEASE=/usr/lib/x86_64-linux-gnu/libz.so
...
-- Could NOT find BZip2 (missing: BZIP2_INCLUDE_DIR)
-- BZIP2_FOUND=[FALSE]
-- BZIP2_LIBRARIES=[/usr/lib/x86_64-linux-gnu/libz.so]
-- BZIP2_INCLUDE_DIR=[BZIP2_INCLUDE_DIR-NOTFOUND]
...
(0034729)
Rolf Eike Beer (developer)
2013-12-05 14:51

This is also the result from my testing: it just works when the header is there or not. So please test again with the example CMakeLists.txt from Brad.
(0036095)
Robert Maynard (manager)
2014-06-02 08:39

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

 Issue History
Date Modified Username Field Change
2013-12-04 06:29 breese New Issue
2013-12-04 06:30 breese File Added: FindBZip2.diff
2013-12-04 08:23 Brad King Note Added: 0034707
2013-12-04 08:23 Brad King Assigned To => Brad King
2013-12-04 08:23 Brad King Status new => resolved
2013-12-04 08:23 Brad King Resolution open => fixed
2013-12-04 08:23 Brad King Fixed in Version => CMake 3.0
2013-12-04 08:23 Brad King Target Version => CMake 3.0
2013-12-04 09:31 Brad King Assigned To Brad King => Rolf Eike Beer
2013-12-04 09:31 Brad King Status resolved => assigned
2013-12-04 09:31 Brad King Resolution fixed => open
2013-12-04 09:31 Brad King Fixed in Version CMake 3.0 =>
2013-12-04 11:20 Brad King Note Added: 0034710
2013-12-05 03:12 breese Note Added: 0034718
2013-12-05 03:13 breese File Added: FindBZip2-b.diff
2013-12-05 11:00 Brad King Note Added: 0034721
2013-12-05 14:51 Rolf Eike Beer Note Added: 0034729
2014-01-27 13:52 Brad King Status assigned => resolved
2014-01-27 13:52 Brad King Resolution open => unable to reproduce
2014-01-27 13:52 Brad King Target Version CMake 3.0 =>
2014-06-02 08:39 Robert Maynard Note Added: 0036095
2014-06-02 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team