v4l2rtspserver/CMake/FindBasicUsageEnvironment.cmake
José Gómez López 669f205ed9 CMakeList.txt search for previous system installation of liveMedia library
Add an alternative HTTPServer definition to be compliant with older liveMedia versions
2021-03-01 12:39:43 +01:00

29 lines
1.1 KiB
CMake

include(GNUInstallDirs)
find_library(
LIBBASICUSAGEENVIRONMENT_LIBRARY
NAMES BasicUsageEnvironment
HINTS ${PROJECT_BINARY_DIR}/live/)
find_path(LIBBASICUSAGEENVIRONMENT_INCLUDE_DIR
NAMES BasicUsageEnvironment_version.hh
HINTS ${PROJECT_BINARY_DIR}/live/ ${CMAKE_INSTALL_INCLUDEDIR}
PATH_SUFFIXES BasicUsageEnvironment)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libBasicUsageEnvironment DEFAULT_MSG
LIBBASICUSAGEENVIRONMENT_LIBRARY
LIBBASICUSAGEENVIRONMENT_INCLUDE_DIR)
mark_as_advanced(LIBBASICUSAGEENVIRONMENT_LIBRARY LIBBASICUSAGEENVIRONMENT_INCLUDE_DIR)
if(LIBBASICUSAGEENVIRONMENT_FOUND AND NOT TARGET libBasicUsageEnvironment::libBasicUsageEnvironment)
add_library(libBasicUsageEnvironment::libBasicUsageEnvironment SHARED IMPORTED)
set_target_properties(
libBasicUsageEnvironment::libBasicUsageEnvironment
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBBASICUSAGEENVIRONMENT_INCLUDE_DIR}"
IMPORTED_LOCATION ${LIBBASICUSAGEENVIRONMENT_LIBRARY})
endif()