Добавлен поиск Qwt
This commit is contained in:
parent
bee24994fc
commit
a00b620cb2
41
FindQwt.cmake
Normal file
41
FindQwt.cmake
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
set(QWT_PREFIX "" CACHE PATH "The path to the prefix of an Qwt installation")
|
||||||
|
|
||||||
|
find_path(QWT_INCLUDE_DIR NAMES qwt.h
|
||||||
|
PATHS
|
||||||
|
${QWT_PREFIX}/include
|
||||||
|
/opt/local/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
PATH_SUFFIXES qwt-qt5 qwt qwt6
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(QWT_LIBRARIES NAMES qwt-qt5 qwt6-qt5 qwt qwt6
|
||||||
|
PATHS
|
||||||
|
${QWT_PREFIX}/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
if(QWT_INCLUDE_DIR AND QWT_LIBRARIES AND NOT TARGET Qwt::Qwt)
|
||||||
|
get_filename_component(QWT_LIBRARY_DIR ${QWT_LIBRARIES} PATH)
|
||||||
|
set(QWT_FOUND TRUE)
|
||||||
|
add_library(Qwt::Qwt INTERFACE IMPORTED)
|
||||||
|
set_target_properties(Qwt::Qwt PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QWT_INCLUDE_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "${QWT_LIBRARIES}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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…
Reference in New Issue
Block a user