forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindSWT.cmake
34 lines (28 loc) · 853 Bytes
/
FindSWT.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
#
# Try to find SWT jar library path.
# Once done this will define
#
# SWT_ECLIPSE_PLUGINS_DIR = directory where Eclipse plugins reside
# SWT_ECLIPSE_LIBRARIES = full path to the SWT jar libraries
set(SWT_FOUND 0)
find_path(SWT_ECLIPSE_PLUGINS_DIR
NAMES plugins
HINTS $ENV{ECLIPSE_HOME}
DOC "Eclipse plugins directory")
mark_as_advanced(SWT_ECLIPSE_PLUGINS_DIR)
if (EXISTS "${SWT_ECLIPSE_PLUGINS_DIR}")
file(GLOB _swt_files "${SWT_ECLIPSE_PLUGINS_DIR}/org.eclipse.swt.*" )
set(SWT_ECLIPSE_LIBRARIES "")
foreach (_swt_file IN LISTS _swt_files)
if (NOT _swt_file MATCHES "^.*source.*")
set(SWT_ECLIPSE_LIBRARIES "${_swt_file}")
set(SWT_FOUND 1)
endif ()
endforeach ()
unset(_swt_file)
unset(_swt_files)
endif ()
if (NOT SWT_FOUND)
set(SWT_NOT_FOUND_MESSAGE
"Failed to find SWT Eclipse plugins.")
endif ()