summaryrefslogtreecommitdiffstats
path: root/Tests/OutOfSource/OutOfSourceSubdir
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-20 12:16:35 (GMT)
committerBrad King <brad.king@kitware.com>2007-03-20 12:16:35 (GMT)
commit75a51cd065b7353f5008aa7a2c7dd10a377a641a (patch)
tree1030aa8635afed5a2da2fb00d2bf7fd65485d644 /Tests/OutOfSource/OutOfSourceSubdir
parent32984af6d1e1600072db8be55ccb2378fd69a72c (diff)
downloadCMake-75a51cd065b7353f5008aa7a2c7dd10a377a641a.zip
CMake-75a51cd065b7353f5008aa7a2c7dd10a377a641a.tar.gz
CMake-75a51cd065b7353f5008aa7a2c7dd10a377a641a.tar.bz2
BUG: Work around VS8 conversion to a relative path for the long source name. It takes the nice full path we give it, converts to relative, and then repacks relative on top of the build directory resulting in a path longer than its own maxpath even though the original path given was short enough. Even VS6 dealt with it better.
Diffstat (limited to 'Tests/OutOfSource/OutOfSourceSubdir')
-rw-r--r--Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
index 4daf425..c5eb71e 100644
--- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
+++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt
@@ -9,8 +9,20 @@ IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
# test cmLocalGenerator::CreateSafeUniqueObjectFileName.
GET_FILENAME_COMPONENT(DEEPDIR
${OutOfSource_BINARY_DIR}/../OutOfSourceDeep/deeper ABSOLUTE)
- # MAXPATH = 250 less 25 for /and/deeper/simple.cxx part and small safety
- MATH(EXPR MAXPATH "250 - 25")
+
+ # The maximum allowed path length on Windows is near this value.
+ SET(MAXPATH "250")
+
+ # VS8 adds "OutOfSource/SubDir/OutOfSourceSubdir/../../../" to the
+ # path of the source file for no good reason. Reduce the length
+ # limit by 46 characters to account for it. It should still be long
+ # enough to require special object file name conversion.
+ IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 8")
+ MATH(EXPR MAXPATH "${MAXPATH} - 46")
+ ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 8")
+
+ # MAXPATH less 25 for last /and/deeper/simple.cxx part and small safety
+ MATH(EXPR MAXPATH "${MAXPATH} - 25")
STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN)
WHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}")
SET(DEEPDIR ${DEEPDIR}/and/deeper)