From edd02607e293bf8e09b0491ab204af2616e43c70 Mon Sep 17 00:00:00 2001 From: Benoit Neil Date: Mon, 6 Apr 2009 19:22:31 +0000 Subject: [PATCH] Fixed Win32 link error and disabled MSVC specific (=annoying) warnings (Reported by Bill Hoffman) --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3d2db2..a2090e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,8 +34,8 @@ INCLUDE_DIRECTORIES( ${CURL_SOURCE_DIR}/include ) # Save C and CXX STD libs (we may need to modify them) IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE) - SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT ${CMAKE_CXX_STANDARD_LIBRARIES}) - SET(CMAKE_C_STANDARD_LIBRARIES_INIT ${CMAKE_C_STANDARD_LIBRARIES}) + SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT ${CMAKE_CXX_STANDARD_LIBRARIES} CACHE INTERNAL "Initial C++ libs") + SET(CMAKE_C_STANDARD_LIBRARIES_INIT ${CMAKE_C_STANDARD_LIBRARIES} CACHE INTERNAL "Initial C libs") ENDIF() IF(WIN32) @@ -109,10 +109,12 @@ MARK_AS_ADVANCED(ENABLE_IPV6) IF(WIN32) IF(CURL_DISABLE_LDAP) #SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib" CACHE STRING "" FORCE) - SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib" CACHE STRING "" FORCE) + #SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib" CACHE STRING "" FORCE) + SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib ws2_32.lib" CACHE STRING "" FORCE) ELSE() #SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE) - SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE) + #SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE) + SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} wsock32.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE) ENDIF() ENDIF() @@ -739,9 +741,12 @@ IF(WIN32) ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) ENDIF(WIN32) +IF(MSVC) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +ENDIF(MSVC) -add_subdirectory(lib) -# add_subdirectory(src) +ADD_SUBDIRECTORY(lib) +# ADD_SUBDIRECTORY(src) # This needs to be run very last so other parts of the scripts can take advantage of this. IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE) -- 2.7.4