This commit is contained in:
Brecht Sanders 2021-09-01 15:28:54 +02:00
parent f09448b28c
commit afd5dd3ed7

View File

@ -1,32 +1,22 @@
# cmake version configuration file for @XLSXIO_NAME@
GET_FILENAME_COMPONENT(XLSXIOREAD_ROOT "${CMAKE_CURRENT_LIST_FILE}" PATH)
# find using pkg_config
PKG_CHECK_MODULES(@XLSXIO_LIB@ REQUIRED @XLSXIO_LIB@)
# find library file
FIND_LIBRARY(@XLSXIO_LIB@_LIBRARY @XLSXIO_LIB@ PATHS ${XLSXIOREAD_ROOT}/lib /usr/local/lib PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE} NO_DEFAULT_PATH )
SET(@XLSXIO_LIB@_LIBRARIES ${@XLSXIO_LIB@_LIBRARY} @XLSXIO_LDFLAGS@)
IF (NOT @XLSXIO_LIB@_FOUND)
# find library file
FIND_LIBRARY(
@XLSXIO_LIB@_LIBRARY @XLSXIO_LIB@
PATHS ${XLSXIOREAD_ROOT}/lib /usr/local/lib
PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
NO_DEFAULT_PATH
)
IF(NOT @XLSXIO_LIB@_LIBRARY)
MESSAGE(FATAL_ERROR "cannot find @XLSXIO_LIB@ library in ${MUPARSERX_ROOT}/lib")
ENDIF()
SET(@XLSXIO_LIB@_LIBRARIES ${@XLSXIO_LIB@_LIBRARY} @XLSXIO_LDFLAGS@)
# find include file
FIND_PATH(
@XLSXIO_LIB@_INCLUDE_DIR @XLSXIO_HEADER@
PATHS ${XLSXIOREAD_ROOT}/include /usr/local/include
NO_DEFAULT_PATH
)
IF(NOT @XLSXIO_LIB@_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "cannot find @XLSXIO_LIB@ includes in ${XLSXIOREAD_ROOT}/include/@XLSXIO_LIB@")
ENDIF()
SET(@XLSXIO_LIB@_INCLUDE_DIRS ${@XLSXIO_LIB@_INCLUDE_DIR})
# find include file
FIND_PATH(@XLSXIO_LIB@_INCLUDE_DIR @XLSXIO_HEADER@ PATHS ${XLSXIOREAD_ROOT}/include /usr/local/include NO_DEFAULT_PATH)
SET(@XLSXIO_LIB@_INCLUDE_DIRS ${@XLSXIO_LIB@_INCLUDE_DIR})
IF(NOT @XLSXIO_LIB@_LIBRARY OR NOT @XLSXIO_LIB@_INCLUDE_DIR)
# find using pkg_config
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(@XLSXIO_LIB@ REQUIRED @XLSXIO_LIB@)
ELSE()
SET(@XLSXIO_LIB@_FOUND TRUE)
ENDIF()
IF(NOT @XLSXIO_LIB@_FOUND)
MESSAGE(FATAL_ERROR "Unable to find library: @XLSXIO_LIB@")
ENDIF()