summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFindEclipseCDT4.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-03-20 21:06:38 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-03-20 21:06:38 (GMT)
commit00af40b29b5170b9709b6a676bf765595d9a0aee (patch)
treefcfe01bc55fd76fbe74edbefa70d9e7a5c83c808 /Modules/CMakeFindEclipseCDT4.cmake
parentd69c2c582584efaa34aa6e2ffc5eb80bacef1324 (diff)
downloadCMake-00af40b29b5170b9709b6a676bf765595d9a0aee.zip
CMake-00af40b29b5170b9709b6a676bf765595d9a0aee.tar.gz
CMake-00af40b29b5170b9709b6a676bf765595d9a0aee.tar.bz2
Eclipse: fix #13036, make version detection work with symlinks
This patch uses get_filename_component(REALPATH) so symlinks in the path to Eclipse are resolved, which makes the version detection work in such cases. Alex
Diffstat (limited to 'Modules/CMakeFindEclipseCDT4.cmake')
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index dd06128..a4264e7 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -20,7 +20,9 @@ FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable"
FUNCTION(_FIND_ECLIPSE_VERSION)
# This code is in a function so the variables used here have only local scope
IF(CMAKE_ECLIPSE_EXECUTABLE)
- GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${CMAKE_ECLIPSE_EXECUTABLE}" PATH)
+ # use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
+ GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
+ GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})