summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-25 16:19:42 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-25 16:19:42 (GMT)
commitf668112039798f5ebc955e127f9c3e4e7cdb5cc4 (patch)
treec08b9117d4d6288c7dd34af6cbffd7e0314188a7 /Source/kwsys/CMakeLists.txt
parentda6b86f4f031b189768dc474721145a1b99f71ea (diff)
parent704ab3d24827cfe5754a00028086f21503c2e08b (diff)
downloadCMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.zip
CMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.tar.gz
CMake-f668112039798f5ebc955e127f9c3e4e7cdb5cc4.tar.bz2
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt58
1 files changed, 52 insertions, 6 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index a9d89d4..3745f78 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -115,6 +115,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_USE_Base64 1)
SET(KWSYS_USE_Directory 1)
SET(KWSYS_USE_DynamicLoader 1)
+ SET(KWSYS_USE_Encoding 1)
SET(KWSYS_USE_Glob 1)
SET(KWSYS_USE_MD5 1)
SET(KWSYS_USE_Process 1)
@@ -125,6 +126,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_USE_FundamentalType 1)
SET(KWSYS_USE_Terminal 1)
SET(KWSYS_USE_IOStream 1)
+ SET(KWSYS_USE_FStream 1)
SET(KWSYS_USE_String 1)
SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_CPU 1)
@@ -133,18 +135,32 @@ ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
# Enforce component dependencies.
IF(KWSYS_USE_SystemTools)
SET(KWSYS_USE_Directory 1)
+ SET(KWSYS_USE_FStream 1)
+ SET(KWSYS_USE_Encoding 1)
ENDIF(KWSYS_USE_SystemTools)
IF(KWSYS_USE_Glob)
SET(KWSYS_USE_Directory 1)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_RegularExpression 1)
+ SET(KWSYS_USE_FStream 1)
+ SET(KWSYS_USE_Encoding 1)
ENDIF(KWSYS_USE_Glob)
IF(KWSYS_USE_Process)
SET(KWSYS_USE_System 1)
+ SET(KWSYS_USE_Encoding 1)
ENDIF(KWSYS_USE_Process)
IF(KWSYS_USE_SystemInformation)
SET(KWSYS_USE_Process 1)
ENDIF(KWSYS_USE_SystemInformation)
+IF(KWSYS_USE_System)
+ SET(KWSYS_USE_Encoding 1)
+ENDIF(KWSYS_USE_System)
+IF(KWSYS_USE_Directory)
+ SET(KWSYS_USE_Encoding 1)
+ENDIF(KWSYS_USE_Directory)
+IF(KWSYS_USE_FStream)
+ SET(KWSYS_USE_Encoding 1)
+ENDIF(KWSYS_USE_FStream)
# Setup the large file support default.
IF(KWSYS_LFS_DISABLE)
@@ -153,6 +169,11 @@ ELSE(KWSYS_LFS_DISABLE)
SET(KWSYS_LFS_REQUESTED 1)
ENDIF(KWSYS_LFS_DISABLE)
+# Specify default 8 bit encoding for Windows
+IF(NOT KWSYS_ENCODING_DEFAULT_CODEPAGE)
+ SET(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_ACP)
+ENDIF(NOT KWSYS_ENCODING_DEFAULT_CODEPAGE)
+
# Enable testing if building standalone.
IF(KWSYS_STANDALONE)
INCLUDE(Dart)
@@ -509,6 +530,12 @@ IF(KWSYS_USE_FundamentalType)
"Checking whether char is signed" DIRECT)
ENDIF(KWSYS_USE_FundamentalType)
+IF(KWSYS_USE_Encoding)
+ # Look for type size helper macros.
+ KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_WSTRING
+ "Checking whether wstring is available" DIRECT)
+ENDIF(KWSYS_USE_Encoding)
+
IF(KWSYS_USE_IOStream)
# Determine whether iostreams support long long.
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
@@ -864,8 +891,8 @@ SET(KWSYS_HXX_FILES Configure String
# Add selected C++ classes.
SET(cppclasses
- Directory DynamicLoader Glob RegularExpression SystemTools
- CommandLineArguments IOStream SystemInformation
+ Directory DynamicLoader Encoding Glob RegularExpression SystemTools
+ CommandLineArguments IOStream FStream SystemInformation
)
FOREACH(cpp ${cppclasses})
IF(KWSYS_USE_${cpp})
@@ -881,7 +908,7 @@ ENDFOREACH(cpp)
# Add selected C components.
FOREACH(c
- Process Base64 FundamentalType MD5 Terminal System String CPU
+ Process Base64 Encoding FundamentalType MD5 Terminal System String CPU
)
IF(KWSYS_USE_${c})
# Use the corresponding header file.
@@ -912,16 +939,24 @@ IF(KWSYS_USE_Process)
ENDIF(KWSYS_USE_Process)
# Add selected C sources.
-FOREACH(c Base64 MD5 Terminal System String)
+FOREACH(c Base64 Encoding MD5 Terminal System String)
IF(KWSYS_USE_${c})
- SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ${c}.c)
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}C.c)
+ LIST(APPEND KWSYS_C_SRCS ${c}C.c)
+ ELSE()
+ LIST(APPEND KWSYS_C_SRCS ${c}.c)
+ ENDIF()
ENDIF(KWSYS_USE_${c})
ENDFOREACH(c)
# Configure headers of C++ classes and construct the list of sources.
FOREACH(c ${KWSYS_CLASSES})
# Add this source to the list of source files for the library.
- SET(KWSYS_CXX_SRCS ${KWSYS_CXX_SRCS} ${c}.cxx)
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}CXX.cxx)
+ LIST(APPEND KWSYS_CXX_SRCS ${c}CXX.cxx)
+ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}.cxx)
+ LIST(APPEND KWSYS_CXX_SRCS ${c}.cxx)
+ ENDIF()
# Configure the header for this class.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${c}.hxx.in ${KWSYS_HEADER_DIR}/${c}.hxx
@@ -1047,6 +1082,12 @@ IF(KWSYS_USE_String)
COMPILE_FLAGS "-DKWSYS_STRING_C")
ENDIF(KWSYS_USE_String)
+IF(KWSYS_USE_Encoding)
+ # Set default 8 bit encoding in "EndcodingC.c".
+ SET_PROPERTY(SOURCE EncodingC.c APPEND PROPERTY COMPILE_DEFINITIONS
+ KWSYS_ENCODING_DEFAULT_CODEPAGE=${KWSYS_ENCODING_DEFAULT_CODEPAGE})
+ENDIF(KWSYS_USE_Encoding)
+
#-----------------------------------------------------------------------------
# Setup testing if not being built as part of another project.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
@@ -1090,6 +1131,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
testCommandLineArguments
testCommandLineArguments1
)
+ IF(KWSYS_STL_HAS_WSTRING)
+ SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
+ testEncoding
+ )
+ ENDIF(KWSYS_STL_HAS_WSTRING)
IF(KWSYS_USE_SystemInformation)
SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} testSystemInformation)
ENDIF(KWSYS_USE_SystemInformation)