myxlib/cmake/FindMyxlib.cmake

79 lines
2.4 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#[=======================================================================[.rst:
FindMyxlib
--------
Поиск библиотеки Myxlib
Входные переменные
^^^^^^^^^^^^^^^^^^
``MYXLIB_PREFIX``
корневой каталог установленной библиотеки.
``MYXLIB_INCLUDE_DIR``
каталог, в котором производится поиск заголовочных файлов.
``MYXLIB_LIBRARY_DIR``
каталог, в котором производится поиск библиотек.
Выходные переменные
^^^^^^^^^^^^^^^^^^^
``MYXLIB_FOUND``
true, если MYXLIB найдена
``MYXLIB_INCLUDE_DIRS``
каталог с найденными заголовочными файлами
``MYXLIB_LIBRARIES``
каталог с найденными библиотеками
#]=======================================================================]
if(NOT MYXLIB_IS_EXTERNAL_PROJECT)
set(MYXLIB_PREFIX "" CACHE PATH "The path to the prefix of an myxlib installation")
set(MYXLIB_INCLUDE_DIR "" CACHE PATH "The path to the headers of an myxlib installation")
set(MYXLIB_LIBRARY_DIR "" CACHE PATH "The path to the library of an myxlib installation")
set(_search_paths "")
if(MYXLIB_INCLUDE_DIR AND EXISTS ${MYXLIB_INCLUDE_DIR})
list(APPEND _search_paths ${MYXLIB_INCLUDE_DIR})
endif()
if(MYXLIB_PREFIX AND EXISTS ${MYXLIB_PREFIX})
list(APPEND _search_paths "${MYXLIB_PREFIX}/include")
endif()
find_path(
MYXLIB_INCLUDE_DIRS
NAMES myx/core/config.hpp
PATHS ${_search_paths})
set(_search_paths "")
if(MYXLIB_LIBRARY_DIR AND EXISTS ${MYXLIB_LIBRARY_DIR})
list(APPEND _search_paths ${MYXLIB_LIBRARY_DIR})
endif()
if(MYXLIB_PREFIX AND EXISTS ${MYXLIB_PREFIX})
list(APPEND _search_paths "${MYXLIB_PREFIX}/lib")
endif()
find_library(
MYXLIB_QT_LIBRARIES
NAMES myx-qt
PATHS ${_search_paths})
find_library(
MYXLIB_FILESYSTEM_LIBRARIES
NAMES myx-filesystem
PATHS ${_search_paths})
unset(_search_paths)
set(MYXLIB_LIBRARIES ${MYXLIB_QT_LIBRARIES} ${MYXLIB_FILESYSTEM_LIBRARIES})
if(MYXLIB_INCLUDE_DIRS AND MYXLIB_LIBRARIES)
set(MYXLIB_FOUND TRUE)
endif()
if(MYXLIB_FOUND)
if(NOT MYXLIB_FIND_QUIETLY)
message(STATUS "Found myxlib")
endif()
set(HAVE_MYXLIB 1)
elseif(MYXLIB_FOUND)
if(MYXLIB_FIND_REQUIRED)
message(FATAL_ERROR "Could not find myxlib")
endif()
endif()
endif()