-
Notifications
You must be signed in to change notification settings - Fork 3
/
plexus-config.cmake.in
60 lines (47 loc) · 1.97 KB
/
plexus-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(plexus_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/@PLEXUS_INSTALL_CMAKEDIR_REVERSE@/@PLEXUS_INSTALL_INCLUDEDIR@" ABSOLUTE)
get_filename_component(plexus_LIBRARY_DIR "${CMAKE_CURRENT_LIST_DIR}/@PLEXUS_INSTALL_CMAKEDIR_REVERSE@/@PLEXUS_INSTALL_LIBDIR@" ABSOLUTE)
if (plexus_USE_SHARED_LIB)
add_library(plexus SHARED IMPORTED)
else()
add_library(plexus STATIC IMPORTED)
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(_bt_postfix "d")
else()
set(_bt_postfix "")
endif()
if(WIN32 AND plexus_USE_SHARED_LIB)
find_file(plexus_DLL libplexus${_bt_postfix}.dll PATHS "${plexus_LIBRARY_DIR}" NO_DEFAULT_PATH)
find_file(plexus_LIB libplexus${_bt_postfix}.lib PATHS "${plexus_LIBRARY_DIR}" NO_DEFAULT_PATH)
if(NOT plexus_DLL)
message(FATAL_ERROR "plexus shared library ${plexus_DLL} not found")
endif()
if(NOT plexus_LIB)
message(FATAL_ERROR "plexus import library ${plexus_LIB} not found")
endif()
set_target_properties(plexus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${plexus_INCLUDE_DIR}
IMPORTED_IMPLIB "${plexus_LIB}"
IMPORTED_LOCATION "${plexus_DLL}")
else()
if (WIN32)
find_file(plexus_LIB libplexus${_bt_postfix}-static.lib PATHS "${plexus_LIBRARY_DIR}" NO_DEFAULT_PATH)
elseif(plexus_USE_SHARED_LIB)
find_file(plexus_LIB libplexus${_bt_postfix}.so PATHS "${plexus_LIBRARY_DIR}" NO_DEFAULT_PATH)
else()
find_file(plexus_LIB libplexus${_bt_postfix}.a PATHS "${plexus_LIBRARY_DIR}" NO_DEFAULT_PATH)
endif()
if(NOT plexus_LIB)
message(FATAL_ERROR "plexus library ${plexus_LIB} not found")
endif()
set_target_properties(plexus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${plexus_INCLUDE_DIR}
IMPORTED_LOCATION "${plexus_LIB}")
endif()
unset(_bt_postfix)
set(plexus_FOUND TRUE)