summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-10 15:46:06 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-10 15:46:06 (GMT)
commit776e21d1c7a3414aff8d307aaaef56abd907d8d5 (patch)
treebe9cf7f403df4f2e21a12df8f09321d782acbf78 /Source/kwsys/CMakeLists.txt
parent7a839be9724be4d17c746823b32aeff33c6498eb (diff)
downloadCMake-776e21d1c7a3414aff8d307aaaef56abd907d8d5.zip
CMake-776e21d1c7a3414aff8d307aaaef56abd907d8d5.tar.gz
CMake-776e21d1c7a3414aff8d307aaaef56abd907d8d5.tar.bz2
COMP: Avoid String.c inclusion by Compaq templates
The Compaq compiler (on VMS) includes 'String.c' in source files that use the stl string while looking for template definitions. This was the true cause of double-inclusion of the 'kwsysPrivate.h' header. We work around the problem by conditionally compiling the entire source file on a condition only true when really building the source.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 871049b..0a816e2 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -848,6 +848,12 @@ ENDIF(KWSYS_ENABLE_C AND KWSYS_C_SRCS)
# line to configure the namespace in the C and C++ source files.
ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}")
+IF(KWSYS_USE_String)
+ # Activate code in "String.c". See the comment in the source.
+ SET_SOURCE_FILES_PROPERTIES(String.c PROPERTIES
+ COMPILE_FLAGS "-DKWSYS_STRING_C")
+ENDIF(KWSYS_USE_String)
+
#-----------------------------------------------------------------------------
# Process execution on windows needs to build a forwarding executable
# that works around a Win9x bug. We encode the executable into a C