diff options
author | Brad King <brad.king@kitware.com> | 2012-10-01 19:18:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-10-01 19:18:30 (GMT) |
commit | 4b8d3639ad42d0ddfaee8cf52e3979b7e60eacc1 (patch) | |
tree | 65e3195a695cd2510819dae228de5f046b2de3ea /Source/kwsys/CMakeLists.txt | |
parent | a61f633737067da7d765c5e479a7d6754d4a083a (diff) | |
parent | 5d0de36d2b2f420ab58841bbcd47c45fcdc4486e (diff) | |
download | CMake-4b8d3639ad42d0ddfaee8cf52e3979b7e60eacc1.zip CMake-4b8d3639ad42d0ddfaee8cf52e3979b7e60eacc1.tar.gz CMake-4b8d3639ad42d0ddfaee8cf52e3979b7e60eacc1.tar.bz2 |
Merge branch 'upstream-kwsys' into import-KWSys-subtree
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index a132357..314ebd6 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/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 |