MantisBT - CMake
View Issue Details
0013316CMakeCMakepublic2012-06-19 05:292012-10-24 17:20
George Petasis 
 
normalblockalways
closedno change required 
Linux 32/64 bitsFedora17
CMake 2.8.8 
CMake 2.8.10CMake 2.8.10 
0013316: FIND_PACKAGE ( X11 REQUIRED ) returns garbage...
Hi all,

The following code:

MESSAGE ( STATUS "Searching for X11..." )
FIND_PACKAGE ( X11 REQUIRED )
IF ( X11_FOUND )
      INCLUDE_DIRECTORIES ( ${X11_INCLUDE_DIR} )
      LINK_LIBRARIES ( ${X11_LIBRARIES} )
      MESSAGE ( STATUS " X11_INCLUDE_DIR: " ${X11_INCLUDE_DIR} )
      MESSAGE ( STATUS " X11_LIBRARIES: " ${X11_LIBRARIES} )
ENDIF ( X11_FOUND )

Prints under Fedora 17:

Searching for X11...
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/libX11.so
-- X11_INCLUDE_DIR: /usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include/usr/include
-- X11_LIBRARIES: /usr/lib/libSM.so/usr/lib/libICE.so/usr/lib/libX11.so/usr/lib/libXext.so
No tags attached.
Issue History
2012-06-19 05:29George PetasisNew Issue
2012-06-19 15:50Rex DieterNote Added: 0029746
2012-06-19 15:51Rex DieterNote Edited: 0029746bug_revision_view_page.php?bugnote_id=29746#r690
2012-06-20 14:17George PetasisNote Added: 0029778
2012-08-13 10:23Rolf Eike BeerNote Added: 0030473
2012-08-13 12:46George PetasisNote Added: 0030570
2012-08-13 13:41Rolf Eike BeerNote Added: 0030572
2012-08-13 13:41Rolf Eike BeerStatusnew => closed
2012-08-13 13:41Rolf Eike BeerResolutionopen => no change required
2012-10-24 17:20David ColeFixed in Version => CMake 2.8.10
2012-10-24 17:20David ColeTarget Version => CMake 2.8.10

Notes
(0029746)
Rex Dieter   
2012-06-19 15:50   
(edited on: 2012-06-19 15:51)
What make you think the values are garbage? They are lists (and they look legit to me). maybe try instead:

MESSAGE ( STATUS " X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}" )
MESSAGE ( STATUS " X11_LIBRARIES: ${X11_LIBRARIES}" )

putting the vars inside the quotes to make it clearer. On my box, I get:
-- X11_INCLUDE_DIR: /usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include
-- X11_LIBRARIES: /usr/lib64/libSM.so;/usr/lib64/libICE.so;/usr/lib64/libX11.so;/usr/lib64/libXext.so

(0029778)
George Petasis   
2012-06-20 14:17   
I didn't know that it was a list, that was simply print wrong.

If it is a list, then this is not a bug.
(0030473)
Rolf Eike Beer   
2012-08-13 10:23   
So it looks like there is no bug and we can just close this?

But looking at this I think we should do a list(REMOVE_DUPLICATES X11_INCLUDE_DIR) at the end of FindX11.cmake, no?
(0030570)
George Petasis   
2012-08-13 12:46   
Yes, this can be closed. It would be nice if duplicates can be removed, but it is not so important.
(0030572)
Rolf Eike Beer   
2012-08-13 13:41   
Closing since no change is required. The simplification is en route for 2.8.10.