Compare commits
2 Commits
862acd75f7
...
cae652a96c
Author | SHA1 | Date | |
---|---|---|---|
cae652a96c | |||
af57d3921c |
75
FindQGLViewer.cmake
Normal file
75
FindQGLViewer.cmake
Normal file
@ -0,0 +1,75 @@
|
||||
# - Try to find QGLViewer
|
||||
# Once done this will define
|
||||
#
|
||||
# QGLVIEWER_FOUND - system has QGLViewer
|
||||
# QGLVIEWER_INCLUDE_DIR - the QGLViewer include directory
|
||||
# QGLVIEWER_LIBRARIES - Link these to use QGLViewer
|
||||
# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer
|
||||
#
|
||||
|
||||
# first look in user defined locations
|
||||
find_path(QGLVIEWER_INCLUDE_DIR
|
||||
NAMES QGLViewer/qglviewer.h
|
||||
NO_DEFAULT_PATH
|
||||
PATHS ENV QGLVIEWERROOT
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
find_library(QGLVIEWER_LIBRARY_RELEASE
|
||||
NAMES qglviewer-qt5 qglviewer QGLViewer-qt5 QGLViewer QGLViewer2-qt5 QGLViewer2
|
||||
NO_DEFAULT_PATH
|
||||
PATHS ENV QGLVIEWERROOT
|
||||
ENV LD_LIBRARY_PATH
|
||||
ENV LIBRARY_PATH
|
||||
/usr/local/lib
|
||||
PATH_SUFFIXES QGLViewer QGLViewer/release
|
||||
)
|
||||
|
||||
find_library(QGLVIEWER_LIBRARY_DEBUG
|
||||
NAMES dqglviewer dQGLViewer-qt5 dQGLViewer dQGLViewer2-qt5 dQGLViewer2 QGLViewerd2-qt5 QGLViewerd2
|
||||
NO_DEFAULT_PATH
|
||||
PATHS /usr/local/lib
|
||||
ENV QGLVIEWERROOT
|
||||
ENV LD_LIBRARY_PATH
|
||||
ENV LIBRARY_PATH
|
||||
PATH_SUFFIXES QGLViewer QGLViewer/debug
|
||||
)
|
||||
|
||||
#now try the standard paths
|
||||
if (NOT QGLVIEWER_INCLUDE_DIR OR NOT QGLVIEWER_LIBRARY_RELEASE OR NOT QGLVIEWER_LIBRARY_DEBUG)
|
||||
find_path(QGLVIEWER_INCLUDE_DIR
|
||||
NAMES QGLViewer/qglviewer.h)
|
||||
|
||||
find_library(QGLVIEWER_LIBRARY_RELEASE
|
||||
NAMES qglviewer-qt5 qglviewer QGLViewer-qt5 QGLViewer QGLViewer2-qt5 QGLViewer2)
|
||||
|
||||
find_library(QGLVIEWER_LIBRARY_DEBUG
|
||||
NAMES dqglviewer dQGLViewer-qt5 dQGLViewer dQGLViewer2-qt5 dQGLViewer2 QGLViewerd2-qt5 QGLViewerd2)
|
||||
|
||||
endif()
|
||||
|
||||
if(QGLVIEWER_LIBRARY_RELEASE)
|
||||
if(QGLVIEWER_LIBRARY_DEBUG)
|
||||
set(QGLVIEWER_LIBRARIES_ optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG})
|
||||
else()
|
||||
set(QGLVIEWER_LIBRARIES_ ${QGLVIEWER_LIBRARY_RELEASE})
|
||||
endif()
|
||||
|
||||
set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library")
|
||||
|
||||
endif()
|
||||
|
||||
IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES)
|
||||
SET(QGLVIEWER_FOUND TRUE)
|
||||
ENDIF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES)
|
||||
|
||||
IF(QGLVIEWER_FOUND)
|
||||
IF(NOT QGLViewer_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found QGLViewer: ${QGLVIEWER_LIBRARIES}")
|
||||
ENDIF(NOT QGLViewer_FIND_QUIETLY)
|
||||
ELSE(QGLVIEWER_FOUND)
|
||||
IF(QGLViewer_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find QGLViewer")
|
||||
ENDIF(QGLViewer_FIND_REQUIRED)
|
||||
ENDIF(QGLVIEWER_FOUND)
|
||||
|
57
FindQwt.cmake
Normal file
57
FindQwt.cmake
Normal file
@ -0,0 +1,57 @@
|
||||
# Find Qwt
|
||||
# ~~~~~~~~
|
||||
# Copyright (c) 2010, Tim Sutton <tim at linfiniti.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# Once run this will define:
|
||||
#
|
||||
# QWT_FOUND = system has QWT lib
|
||||
# QWT_LIBRARY = full path to the QWT library
|
||||
# QWT_INCLUDE_DIR = where to find headers
|
||||
#
|
||||
|
||||
|
||||
set(QWT_LIBRARY_NAMES qwt-qt5 qwt6-qt5 qwt qwt6)
|
||||
|
||||
find_library(QWT_LIBRARY
|
||||
NAMES ${QWT_LIBRARY_NAMES}
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/usr/local/lib/qt5
|
||||
"$ENV{LIB_DIR}/lib"
|
||||
"$ENV{LIB}"
|
||||
)
|
||||
|
||||
set(_qwt_fw)
|
||||
if(QWT_LIBRARY MATCHES "/qwt.*\\.framework")
|
||||
string(REGEX REPLACE "^(.*/qwt.*\\.framework).*$" "\\1" _qwt_fw "${QWT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
FIND_PATH(QWT_INCLUDE_DIR NAMES qwt.h PATHS
|
||||
"${_qwt_fw}/Headers"
|
||||
/usr/include
|
||||
/usr/include/qt5
|
||||
/usr/local/include
|
||||
/usr/local/include/qt5
|
||||
"$ENV{LIB_DIR}/include"
|
||||
"$ENV{INCLUDE}"
|
||||
PATH_SUFFIXES qwt-qt5 qwt qwt6
|
||||
)
|
||||
|
||||
IF (QWT_INCLUDE_DIR AND QWT_LIBRARY)
|
||||
SET(QWT_FOUND TRUE)
|
||||
ENDIF (QWT_INCLUDE_DIR AND QWT_LIBRARY)
|
||||
|
||||
IF (QWT_FOUND)
|
||||
FILE(READ ${QWT_INCLUDE_DIR}/qwt_global.h qwt_header)
|
||||
STRING(REGEX REPLACE "^.*QWT_VERSION_STR +\"([^\"]+)\".*$" "\\1" QWT_VERSION_STR "${qwt_header}")
|
||||
IF (NOT QWT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Qwt: ${QWT_LIBRARY} (${QWT_VERSION_STR})")
|
||||
ENDIF (NOT QWT_FIND_QUIETLY)
|
||||
ELSE (QWT_FOUND)
|
||||
IF (QWT_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Qwt")
|
||||
ENDIF (QWT_FIND_REQUIRED)
|
||||
ENDIF (QWT_FOUND)
|
Loading…
x
Reference in New Issue
Block a user