Warning, /education/labplot/cmake/FindOrcus.cmake is written in an unsupported language. File is not indexed.

0001 # - Find Orcus
0002 # Find the Orcus filter library.
0003 #
0004 # This module defines
0005 #  Orcus_FOUND - whether the Orcus library was found
0006 #  Orcus_LIBRARIES - the Orcus library
0007 #  Orcus_INCLUDE_DIR - the include path of the Orcus library
0008 
0009 # SPDX-FileCopyrightText: 2022 Stefan Gerlach <stefan.gerlach@uni.kn>
0010 # SPDX-License-Identifier: BSD-3-Clause
0011 
0012 if (Orcus_INCLUDE_DIR AND Orcus_LIBRARIES)
0013     # Already in cache
0014     set (Orcus_FOUND TRUE)
0015 else ()
0016     find_package(PkgConfig QUIET)
0017     pkg_check_modules(PC_ORCUS liborcus-0.17 QUIET)
0018     pkg_check_modules(PC_IXION libixion-0.17 QUIET)
0019 
0020     find_library (Orcus_LIBRARY
0021         NAMES orcus orcus-0.17
0022         HINTS ${PC_ORCUS_LIBRARY_DIRS}
0023         PATH_SUFFIXES orcus
0024     )
0025     find_library (Orcus_parser_LIBRARY
0026         NAMES orcus-parser orcus-parser-0.17
0027         HINTS ${PC_ORCUS_LIBRARY_DIRS}
0028         PATH_SUFFIXES orcus
0029     )
0030     find_library (Orcus_spreadsheet_LIBRARY
0031         NAMES orcus-spreadsheet-model orcus-spreadsheet-model-0.17
0032         HINTS ${PC_ORCUS_LIBRARY_DIRS}
0033         PATH_SUFFIXES orcus
0034     )
0035     set(Orcus_LIBRARIES ${Orcus_LIBRARY} ${Orcus_parser_LIBRARY} ${Orcus_spreadsheet_LIBRARY})
0036 
0037     find_library (Ixion_LIBRARY
0038         NAMES ixion ixion-0.17
0039         HINTS ${PC_IXION_LIBRARY_DIRS}
0040         PATH_SUFFIXES orcus
0041     )
0042     find_path (Orcus_INCLUDE_DIR
0043         NAMES orcus/orcus_ods.hpp
0044         HINTS ${PC_ORCUS_INCLUDE_DIRS}
0045         PATH_SUFFIXES orcus
0046     )
0047     find_path (Ixion_INCLUDE_DIR
0048         NAMES ixion/info.hpp
0049         HINTS ${PC_IXION_INCLUDE_DIRS}
0050         PATH_SUFFIXES ixion
0051     )
0052 
0053     include (FindPackageHandleStandardArgs)
0054     find_package_handle_standard_args (Orcus DEFAULT_MSG Orcus_LIBRARIES Orcus_INCLUDE_DIR Ixion_INCLUDE_DIR)
0055 endif ()
0056 
0057 mark_as_advanced(Orcus_INCLUDE_DIR Ixion_INCLUDE_DIR Orcus_LIBRARY Orcus_parser_LIBRARY Orcus_spreadsheet_LIBRARY Orcus_LIBRARIES Ixion_LIBRARY)
0058 
0059 if (Orcus_FOUND)
0060    add_library(Orcus UNKNOWN IMPORTED)
0061    set_target_properties(Orcus PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${Orcus_INCLUDE_DIR} IMPORTED_LOCATION "${Orcus_LIBRARIES} ${Ixion_LIBRARY}")
0062 endif()