[cmake-developers] [CMake 0013281]: the module UseJava reports a warning when find_jar is used with a list of NAMES

Mantis Bug Tracker mantis at public.kitware.com
Fri Jun 8 07:39:40 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=13281 
====================================================================== 
Reported By:                renzodenardi
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13281
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-06-08 07:39 EDT
Last Modified:              2012-06-08 07:39 EDT
====================================================================== 
Summary:                    the module UseJava reports a warning when find_jar
is used with a list of NAMES
Description: 
when the command find_jar is used with multiple jar names e.g.

find_jar(PROTO_JAVA NAMES protobuf protobuf-java)

cmake reports a warning:

CMake Warning at cmake/Modules/UseJava.cmake:523 (if):
  given arguments:

    "protobuf" "protobuf-java" "STREQUAL" ""

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:75 (find_jar)

Steps to Reproduce: 
use the following as a CMakeLists.txt


PROJECT(TEST)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
set(PACKAGE_NAME 	"test")
FIND_PACKAGE(Java)
INCLUDE(UseJava)
find_jar(PROTO_JAVA NAMES a_name another_name)

Additional Information: 
as far as I understand this is due to the fact that the variable _jar_names in
the function find_jar is actually a list, therefore the correct way of checking
if it is empty is to test its length.

A patch is attached.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-08 07:39 renzodenardi   New Issue                                    
2012-06-08 07:39 renzodenardi   File Added: UseJava.cmake.patch                 
  
======================================================================




More information about the cmake-developers mailing list