View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013281CMakeCMakepublic2012-06-08 07:392013-01-09 10:55
Reporterrenzodenardi 
Assigned ToRolf Eike Beer 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformUbuntu 10.0.4OSGNU/LinuxOS Version2.6.32-21-generi
Product VersionCMake-2-8 
Target VersionCMake 2.8.9Fixed in VersionCMake 2.8.9 
Summary0013281: the module UseJava reports a warning when find_jar is used with a list of NAMES
Descriptionwhen 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 Reproduceuse 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 Informationas 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.
TagsNo tags attached.
Attached Filespatch file icon UseJava.cmake.patch [^] (565 bytes) 2012-06-08 07:39 [Show Content]

 Relationships

  Notes
(0029646)
David Cole (manager)
2012-06-08 08:06

A simpler change would be to quote the argument to the "if" call like this:

  if ("${_jar_names}" STREQUAL "")
(0029648)
Rolf Eike Beer (developer)
2012-06-08 11:36

Fix pushed to next:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5593d5718ec90f6a2e37ca4e2fdf3fc4537380ff [^]
(0032030)
Robert Maynard (manager)
2013-01-09 10:55

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

 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
2012-06-08 08:06 David Cole Note Added: 0029646
2012-06-08 11:36 Rolf Eike Beer Note Added: 0029648
2012-06-08 11:36 Rolf Eike Beer Assigned To => Rolf Eike Beer
2012-06-08 11:36 Rolf Eike Beer Status new => resolved
2012-06-08 11:36 Rolf Eike Beer Resolution open => fixed
2012-06-08 11:36 Rolf Eike Beer Fixed in Version => CMake 2.8.9
2012-08-09 19:37 David Cole Target Version => CMake 2.8.9
2013-01-09 10:55 Robert Maynard Note Added: 0032030
2013-01-09 10:55 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team