File: FindReadStat.cmake

package info (click to toggle)
labplot 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,500 kB
  • sloc: cpp: 241,048; ansic: 6,324; python: 915; xml: 400; yacc: 237; sh: 221; awk: 35; makefile: 11
file content (35 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#=============================================================================
# SPDX-FileCopyrightText: 2020 Stefan Gerlach <stefan.gerlach@uni.kn>
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================

# readstat build on Windows creates readstat.dll.lib when shared libs are enabled
find_library(READSTAT_LIBRARIES NAMES readstat readstat.dll)

find_path(READSTAT_INCLUDE_DIR readstat.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ReadStat
    FOUND_VAR
        READSTAT_FOUND
    REQUIRED_VARS
        READSTAT_LIBRARIES
        READSTAT_INCLUDE_DIR
)

if(READSTAT_FOUND AND NOT TARGET readstat)
    add_library(readstat UNKNOWN IMPORTED)
    set_target_properties(readstat PROPERTIES
        IMPORTED_LOCATION "${READSTAT_LIBRARIES}"
	INTERFACE_INCLUDE_DIRECTORIES "${READSTAT_INCLUDE_DIR}"
    )
endif()

mark_as_advanced(READSTAT_LIBRARIES READSTAT_INCLUDE_DIR)

include(FeatureSummary)
set_package_properties(ReadStat PROPERTIES
    DESCRIPTION "A command-line tool and library for reading files from popular stats packages"
    URL "https://github.com/WizardMac/ReadStat"
)