MantisBT - CMake
View Issue Details
0015220CMakeModulespublic2014-10-27 12:102015-04-06 09:07
Anton Indrawan 
Brad King 
normalminoralways
closedfixed 
QNX6.5
CMake 3.0 
CMake 3.1CMake 3.1 
0015220: Find_package(Curses) failed for QNX 6.5 and QNX 6.6
When using find_package(Curses) for a cmake project compiled with the QNX 6.5 or QNX 6.6 toolchain, cmake threw the following error:

CMake Error at /usr/local/share/cmake-3.0/Modules/FindCurses.cmake:139 (CHECK_LIBRARY_EXISTS):
  Unknown CMake command "CHECK_LIBRARY_EXISTS".
Call Stack (most recent call first):
  TestProgram/curses/CMakeLists.txt:3 (find_package)

The same error is reproducible on cmake 3.0.2.




To reproduce the issue, you have to have a QNX 6.5 or QNX 6.6 toolchain installed.

1. Please create a simple cmake project which calls "find_package(Curses)"
project(test.curses)

find_package(Curses)

add_executable(${PROJECT_NAME} main.cpp)


2. In the main.cpp, it can just be an empty int main.

The toolchains I am using are standard QNX 6.5 and QNX 6.6 toolchains downloaded from www.qnx.com.

The host OS is Ubuntu 12.04 64-bit.
No tags attached.
Issue History
2014-10-27 12:10Anton IndrawanNew Issue
2014-10-27 13:36Ben BoeckelNote Added: 0037076
2014-10-28 08:51Brad KingNote Added: 0037083
2014-10-28 08:58Brad KingNote Added: 0037084
2014-10-28 08:58Brad KingAssigned To => Brad King
2014-10-28 08:58Brad KingStatusnew => assigned
2014-10-28 08:58Brad KingTarget Version => CMake 3.2
2014-10-31 11:40Brad KingNote Added: 0037118
2014-10-31 11:40Brad KingStatusassigned => resolved
2014-10-31 11:40Brad KingResolutionopen => fixed
2014-10-31 11:40Brad KingFixed in Version => CMake 3.1
2014-10-31 11:40Brad KingTarget VersionCMake 3.2 => CMake 3.1
2015-04-06 09:07Robert MaynardNote Added: 0038434
2015-04-06 09:07Robert MaynardStatusresolved => closed

Notes
(0037076)
Ben Boeckel   
2014-10-27 13:36   
Looks like CheckLibraryExists.cmake is included in one if() block while also being used in another if block with a different condition on it. CheckLibraryExists.cmake should probably be included unconditionally.
(0037083)
Brad King   
2014-10-28 08:51   
Please try this patch:

diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 0184c39..6e17411 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -100,6 +100,7 @@ if(CURSES_CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
 endif()
 
 if(CURSES_USE_NCURSES)
+  include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
   get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
   get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
(0037084)
Brad King   
2014-10-28 08:58   
Re 0015220:0037076: Yes, unconditional inclusion is simpler. Done:

 FindCurses: Include CheckLibraryExists before using it
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f11f9579 [^]
(0037118)
Brad King   
2014-10-31 11:40   
I've merged this to the 'release' branch for inclusion in the next 3.1 release candidate.
(0038434)
Robert Maynard   
2015-04-06 09:07   
Closing resolved issues that have not been updated in more than 4 months.