Skip to content

Commit ed78af2

Browse files
committed
Fix QGLViewer library names for Ubuntu wily and xenial, make QGLViewer linking more robust using full paths
1 parent 3ac9874 commit ed78af2

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

octovis/CMakeModules/FindQGLViewer.cmake

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FIND_PATH( QGLViewer_INCLUDE_DIR qglviewer.h
2323
${QGLVIEWER_BASE_DIR}
2424
)
2525

26-
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_UBUNTU qglviewer-qt4 )
26+
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_UBUNTU NAMES qglviewer-qt4 QGLViewer-qt4)
2727
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_WINDOWS QGLViewer2 ${QGLVIEWER_BASE_DIR})
2828
FIND_LIBRARY( QGLViewer_LIBRARY_DIR_OTHER QGLViewer ${QGLVIEWER_BASE_DIR})
2929

@@ -33,22 +33,16 @@ IF( QGLViewer_INCLUDE_DIR )
3333

3434
MESSAGE(STATUS "QGLViewer includes found in ${QGLViewer_INCLUDE_DIR}")
3535
IF (QGLViewer_LIBRARY_DIR_UBUNTU)
36-
MESSAGE(STATUS "qglviewer-qt4 found in ${QGLViewer_LIBRARY_DIR_UBUNTU}")
37-
# strip filename from path
38-
GET_FILENAME_COMPONENT( QGLViewer_LIBRARY_DIR ${QGLViewer_LIBRARY_DIR_UBUNTU} PATH CACHE )
39-
SET( QGLViewer_LIBRARIES qglviewer-qt4)
36+
MESSAGE(STATUS "QGLViewer library found in ${QGLViewer_LIBRARY_DIR_UBUNTU}")
37+
SET( QGLViewer_LIBRARIES ${QGLViewer_LIBRARY_DIR_UBUNTU})
4038
SET( QGLViewer_FOUND 1 CACHE BOOL "Do we have QGLViewer?" FORCE )
4139
ELSEIF(QGLViewer_LIBRARY_DIR_WINDOWS)
42-
# strip filename from path
43-
GET_FILENAME_COMPONENT( QGLViewer_LIBRARY_DIR ${QGLViewer_LIBRARY_DIR_WINDOWS} PATH CACHE )
44-
SET( QGLViewer_LIBRARIES QGLViewer2)
40+
MESSAGE(STATUS "QGLViewer2 found in ${QGLViewer_LIBRARY_DIR_WINDOWS}")
41+
SET( QGLViewer_LIBRARIES ${QGLViewer_LIBRARY_DIR_WINDOWS})
4542
SET( QGLViewer_FOUND 1 CACHE BOOL "Do we have QGLViewer?" FORCE )
46-
MESSAGE(STATUS "QGLViewer2.lib found in ${QGLViewer_LIBRARY_DIR}")
4743
ELSEIF(QGLViewer_LIBRARY_DIR_OTHER)
48-
MESSAGE(STATUS "QGLViewer found: ${QGLViewer_LIBRARY_DIR_OTHER}")
49-
# strip filename from path
50-
GET_FILENAME_COMPONENT( QGLViewer_LIBRARY_DIR ${QGLViewer_LIBRARY_DIR_OTHER} PATH CACHE )
51-
SET( QGLViewer_LIBRARIES QGLViewer)
44+
MESSAGE(STATUS "QGLViewer found in ${QGLViewer_LIBRARY_DIR_OTHER}")
45+
SET( QGLViewer_LIBRARIES ${QGLViewer_LIBRARY_DIR_OTHER})
5246
SET( QGLViewer_FOUND 1 CACHE BOOL "Do we have QGLViewer?" FORCE )
5347
ELSE()
5448
MESSAGE(STATUS "QGLViewer library not found.")

0 commit comments

Comments
 (0)