-
Notifications
You must be signed in to change notification settings - Fork 0
/
tubus-config.cmake.in
60 lines (47 loc) · 1.93 KB
/
tubus-config.cmake.in
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
48
49
50
51
52
53
54
55
56
57
58
59
60
include(CMakeFindDependencyMacro)
find_dependency(Boost)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_dependency(Threads)
unset(CMAKE_THREAD_PREFER_PTHREAD)
get_filename_component(tubus_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/@TUBUS_INSTALL_CMAKEDIR_REVERSE@/@TUBUS_INSTALL_INCLUDEDIR@" ABSOLUTE)
get_filename_component(tubus_LIBRARY_DIR "${CMAKE_CURRENT_LIST_DIR}/@TUBUS_INSTALL_CMAKEDIR_REVERSE@/@TUBUS_INSTALL_LIBDIR@" ABSOLUTE)
if (tubus_USE_SHARED_LIB)
add_library(tubus SHARED IMPORTED)
else()
add_library(tubus STATIC IMPORTED)
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(_bt_postfix "d")
else()
set(_bt_postfix "")
endif()
if(WIN32 AND tubus_USE_SHARED_LIB)
find_file(tubus_DLL libtubus${_bt_postfix}.dll PATHS "${tubus_LIBRARY_DIR}" NO_DEFAULT_PATH)
find_file(tubus_LIB libtubus${_bt_postfix}.lib PATHS "${tubus_LIBRARY_DIR}" NO_DEFAULT_PATH)
if(NOT tubus_DLL)
message(FATAL_ERROR "tubus shared library ${tubus_DLL} not found")
endif()
if(NOT tubus_LIB)
message(FATAL_ERROR "tubus import library ${tubus_LIB} not found")
endif()
set_target_properties(tubus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${tubus_INCLUDE_DIR}
IMPORTED_IMPLIB "${tubus_LIB}"
IMPORTED_LOCATION "${tubus_DLL}")
else()
if (WIN32)
find_file(tubus_LIB libtubus${_bt_postfix}-static.lib PATHS "${tubus_LIBRARY_DIR}" NO_DEFAULT_PATH)
elseif(tubus_USE_SHARED_LIB)
find_file(tubus_LIB libtubus${_bt_postfix}.so PATHS "${tubus_LIBRARY_DIR}" NO_DEFAULT_PATH)
else()
find_file(tubus_LIB libtubus${_bt_postfix}.a PATHS "${tubus_LIBRARY_DIR}" NO_DEFAULT_PATH)
endif()
if(NOT tubus_LIB)
message(FATAL_ERROR "tubus library ${tubus_LIB} not found")
endif()
set_target_properties(tubus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${tubus_INCLUDE_DIR}
IMPORTED_LOCATION "${tubus_LIB}")
endif()
unset(_bt_postfix)
set(tubus_FOUND TRUE)