File: FindLib3ds.cmake

package info (click to toggle)
freespace2 25.0.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 47,232 kB
  • sloc: cpp: 657,500; ansic: 22,305; sh: 293; python: 200; makefile: 198; xml: 181
file content (47 lines) | stat: -rw-r--r-- 1,407 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
36
37
38
39
40
41
42
43
44
45
46
47
# - Find lib3ds
# Find the lib3ds model access library
#
#  Lib3ds::Lib3ds - Imported target to use
#  LIB3DS_FOUND - True if lib3ds was found.
#
# Original Author:
# 2019 Rylie Pavlik <rylie.pavlik@collabora.com> <rylie@ryliepavlik.com>
#
# Copyright 2019, Collabora, Ltd.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# SPDX-License-Identifier: BSL-1.0

set(LIB3DS_ROOT_DIR
    "${LIB3DS_ROOT_DIR}"
    CACHE PATH "Directory to search for lib3ds")
find_path(
    LIB3DS_INCLUDE_DIR
    NAMES lib3ds/types.h
    PATHS "${LIB3DS_ROOT_DIR}")
find_library(
    LIB3DS_LIBRARY
    NAMES 3ds 3ds-1
    PATHS "${LIB3DS_ROOT_DIR}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIB3DS DEFAULT_MSG LIB3DS_INCLUDE_DIR
                                  LIB3DS_LIBRARY)

if(LIB3DS_FOUND)
    if(NOT TARGET Lib3ds::Lib3ds)
        add_library(Lib3ds::Lib3ds UNKNOWN IMPORTED)
        set_target_properties(
            Lib3ds::Lib3ds
            PROPERTIES IMPORTED_LOCATION "${LIB3DS_LIBRARY}"
                       INTERFACE_INCLUDE_DIRECTORIES "${LIB3DS_INCLUDE_DIR}")
    endif()
    set(LIB3DS_INCLUDE_DIRS ${LIB3DS_INCLUDE_DIR})
    set(LIB3DS_LIBRARIES ${LIB3DS_LIBRARY})
    mark_as_advanced(LIB3DS_ROOT_DIR)
endif()

mark_as_advanced(LIB3DS_INCLUDE_DIR LIB3DS_LIBRARY)