-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFindgalaxy.cmake
61 lines (54 loc) · 1.36 KB
/
Findgalaxy.cmake
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
61
# Ad-hoc writings by Arseniy Terekhin<[email protected]>.
# Suggestions are welcomed!
set(GALAXY_DIR "" CACHE STRING "galaxy directory hint")
find_path(GALAXY_INCLUDE_DIR GxIAPI.h
HINTS
${GALAXY_DIR}
$ENV{GALAXY_DIR}
$ENV{HOME}/.local
PATH_SUFFIXES inc include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/include
/mingw/include
)
if (GALAXY_INCLUDE_DIR)
file(STRINGS "${GALAXY_INCLUDE_DIR}/GxIAPI.h" _GALAXY_VERSION_STRING REGEX "^@Version[ \t]+(.*)")
string(REGEX REPLACE "@Version[ \t]+(.*)" "\\1" GALAXY_VERSION_STRING "${_GALAXY_VERSION_STRING}")
endif()
include(FindPackageHandleStandardArgs)
find_library(GALAXY_GXI_LIBRARY
NAMES libgxiapi.so
HINTS
${GALAXY_DIR}
$ENV{GALAXY_DIR}
$ENV{HOME}/.local
PATH_SUFFIXES lib lib/x86_64
PATHS
/usr/local
/usr
/sw
/opt/local
/opt
/mingw
"${GALAXY_INCLUDE_DIR}/../lib/x86_64"
)
find_package_handle_standard_args(
galaxy
REQUIRED_VARS
GALAXY_INCLUDE_DIR
GALAXY_GXI_LIBRARY
VERSION_VAR GALAXY_VERSION_STRING
)
if(GALAXY_FOUND AND NOT TARGET galaxy)
get_filename_component(galaxy_LINK_DIRECTORIES "${GALAXY_GXI_LIBRARY}" DIRECTORY)
add_library(galaxy UNKNOWN IMPORTED)
set_target_properties(galaxy PROPERTIES
IMPORTED_LOCATION "${GALAXY_GXI_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GALAXY_INCLUDE_DIR}")
endif()