summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2012-10-01 18:58:49 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-01 19:02:39 (GMT)
commit5d0de36d2b2f420ab58841bbcd47c45fcdc4486e (patch)
tree8cc5e0a3032c60cdc2f6c96d8fd00149df723954 /CMakeLists.txt
parent7d3c2959fa9cb65b3be81bdfe3f69c29d31a9e67 (diff)
downloadCMake-5d0de36d2b2f420ab58841bbcd47c45fcdc4486e.zip
CMake-5d0de36d2b2f420ab58841bbcd47c45fcdc4486e.tar.gz
CMake-5d0de36d2b2f420ab58841bbcd47c45fcdc4486e.tar.bz2
KWSys 2012-10-01 (bab53989)
Extract upstream KWSys using the following shell code. $ sha1=bab53989d7c4027259bff837574f75003396d59f && git archive --prefix=KWSys-snapshot/ $sha1 | tar x $ git log 719638e2..bab53989 ^341043cf --no-merges --oneline --abbrev=8 bab53989 Tell Git to check tab-in-indent and no-lf-at-eof 8115bd1b SystemInformation: Pass extern "C" functions to sigaction 4f4dd224 SystemInformation: Fix unused assignment warnings 6b26d2fe SystemInformation: Use ifaddrs.h only where available 381923ed SystemInformation: Use si_code constants only where available 8f85338c SystemInformation: Use execinfo.h backtrace only where available a8e98f98 SystemInformation: Use Windows API more portably 750b4b5c SystemInformation: Use long long or __int64 only where available 8d2cafcd SystemInformation: Fix UNIX system includes for FQDN 857bda17 SystemInformation: Report more information 63cbea35 Add and configure developer setup helper scripts 924466f5 SystemTools: Fix accidental bitwise instead of logical OR 2f423229 SystemTools: Remove unused environ declaration a49c2417 Disable warnings about MS deprecation of C library e3390720 CTestConfig: Submit to dedicated KWSys dashboard
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt40
1 files changed, 36 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a132357..314ebd6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -566,9 +566,28 @@ IF(KWSYS_USE_SystemTools)
ENDIF()
IF(KWSYS_USE_SystemInformation)
- SET_PROPERTY(SOURCE SystemInformation.cxx PROPERTY
- COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=${KWSYS_USE_LONG_LONG}
- KWSYS_USE___INT64=${KWSYS_USE___INT64})
+ IF(NOT CYGWIN)
+ INCLUDE(CheckIncludeFiles)
+ CHECK_INCLUDE_FILES("sys/types.h;ifaddrs.h" KWSYS_SYS_HAS_IFADDRS_H)
+ IF(KWSYS_SYS_HAS_IFADDRS_H)
+ SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
+ COMPILE_DEFINITIONS KWSYS_SYS_HAS_IFADDRS_H=1)
+ ENDIF()
+ ENDIF()
+ IF(WIN32)
+ INCLUDE(CheckSymbolExists)
+ SET(CMAKE_REQUIRED_LIBRARIES Psapi)
+ CHECK_SYMBOL_EXISTS(GetProcessMemoryInfo "windows.h;psapi.h" KWSYS_SYS_HAS_PSAPI)
+ UNSET(CMAKE_REQUIRED_LIBRARIES)
+ IF(KWSYS_SYS_HAS_PSAPI)
+ SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
+ COMPILE_DEFINITIONS KWSYS_SYS_HAS_PSAPI=1)
+ IF(MSVC70 OR MSVC71)
+ # Suppress LNK4089: all references to 'PSAPI.DLL' discarded by /OPT:REF
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /IGNORE:4089")
+ ENDIF()
+ ENDIF()
+ ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
@@ -802,9 +821,12 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
ENDIF(UNIX)
ENDIF(KWSYS_USE_DynamicLoader)
-
+
IF(KWSYS_USE_SystemInformation AND WIN32)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ws2_32)
+ IF(KWSYS_SYS_HAS_PSAPI)
+ TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} Psapi)
+ ENDIF()
ENDIF(KWSYS_USE_SystemInformation AND WIN32)
# Apply user-defined target properties to the library.
@@ -842,6 +864,16 @@ 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}")
+# Disable deprecation warnings for standard C functions.
+IF(MSVC OR (WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$"))
+ ADD_DEFINITIONS(
+ -D_CRT_NONSTDC_NO_DEPRECATE
+ -D_CRT_SECURE_NO_DEPRECATE
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_SCL_SECURE_NO_DEPRECATE
+ )
+ENDIF()
+
IF(KWSYS_USE_String)
# Activate code in "String.c". See the comment in the source.
SET_SOURCE_FILES_PROPERTIES(String.c PROPERTIES