2021-06-24 08:44:55 +00:00
|
|
|
if(NOT MYXLIB_IS_EXTERNAL_PROJECT)
|
2021-06-29 05:14:16 +00:00
|
|
|
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")
|
2021-06-22 14:39:47 +00:00
|
|
|
|
2021-06-29 05:14:16 +00:00
|
|
|
set(_search_paths "")
|
2021-06-29 08:30:29 +00:00
|
|
|
if(MYXLIB_INCLUDE_DIR AND EXISTS ${MYXLIB_INCLUDE_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${MYXLIB_INCLUDE_DIR})
|
|
|
|
endif()
|
2021-06-29 08:30:29 +00:00
|
|
|
if(MYXLIB_PREFIX AND EXISTS ${MYXLIB_PREFIX})
|
|
|
|
list(APPEND _search_paths "${MYXLIB_PREFIX}/include")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
2021-06-22 22:30:10 +00:00
|
|
|
find_path(
|
|
|
|
MYXLIB_INCLUDE_DIRS
|
|
|
|
NAMES myx/core/config.hpp
|
2021-06-29 05:14:16 +00:00
|
|
|
PATHS ${_search_paths})
|
|
|
|
|
|
|
|
set(_search_paths "")
|
2021-06-29 08:30:29 +00:00
|
|
|
if(MYXLIB_LIBRARY_DIR AND EXISTS ${MYXLIB_LIBRARY_DIR})
|
2021-06-29 05:14:16 +00:00
|
|
|
list(APPEND _search_paths ${MYXLIB_LIBRARY_DIR})
|
|
|
|
endif()
|
2021-06-29 08:30:29 +00:00
|
|
|
if(MYXLIB_PREFIX AND EXISTS ${MYXLIB_PREFIX})
|
|
|
|
list(APPEND _search_paths "${MYXLIB_PREFIX}/lib")
|
2021-06-29 05:14:16 +00:00
|
|
|
endif()
|
2021-06-22 22:30:10 +00:00
|
|
|
find_library(
|
2021-06-29 05:14:16 +00:00
|
|
|
MYXLIB_QT_LIBRARIES
|
2021-06-22 22:30:10 +00:00
|
|
|
NAMES myx-qt
|
2021-06-29 05:14:16 +00:00
|
|
|
PATHS ${_search_paths})
|
2021-06-22 22:30:10 +00:00
|
|
|
find_library(
|
2021-06-29 05:14:16 +00:00
|
|
|
MYXLIB_FILESYSTEM_LIBRARIES
|
2021-06-22 22:30:10 +00:00
|
|
|
NAMES myx-filesystem
|
2021-06-29 05:14:16 +00:00
|
|
|
PATHS ${_search_paths})
|
|
|
|
unset(_search_paths)
|
|
|
|
set(MYXLIB_LIBRARIES ${MYXLIB_QT_LIBRARIES} ${MYXLIB_FILESYSTEM_LIBRARIES})
|
2021-06-22 14:39:47 +00:00
|
|
|
|
2021-06-29 05:14:16 +00:00
|
|
|
if(MYXLIB_INCLUDE_DIRS AND MYXLIB_LIBRARIES)
|
2021-06-22 22:30:10 +00:00
|
|
|
set(MYXLIB_FOUND TRUE)
|
2021-06-22 14:39:47 +00:00
|
|
|
endif()
|
2021-06-22 22:30:10 +00:00
|
|
|
|
|
|
|
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()
|
2021-06-22 14:39:47 +00:00
|
|
|
endif()
|
|
|
|
endif()
|