Commit b3765e87 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Do not use CMakePushCheckState module with CMake version lower than 2.8.6.

parent dbb21ad9
......@@ -43,7 +43,6 @@ set(WITH_CUNIT "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where libcunit
set(WITH_POLARSSL "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where polarssl can be found (ex:/usr or /usr/local)")
include(CMakePushCheckState)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckSymbolExists)
......@@ -72,7 +71,6 @@ res_getservers(NULL,NULL,0);
return 0;
}"
HAVE_RES_GETSERVERS)
cmake_reset_check_state()
if(NOT "${HAVE_RES_NDESTROY}" STREQUAL "" AND NOT "${HAVE_RES_GETSERVERS}" STREQUAL "")
set(HAVE_RESINIT 1)
endif(NOT "${HAVE_RES_NDESTROY}" STREQUAL "" AND NOT "${HAVE_RES_GETSERVERS}" STREQUAL "")
......
......@@ -29,7 +29,9 @@
find_package(Java)
include(CMakePushCheckState)
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
include(CMakePushCheckState)
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
include(CheckIncludeFile)
include(CheckFunctionExists)
......@@ -70,11 +72,21 @@ if(NOT "${ANTLR3C_INCLUDE_DIR}" STREQUAL "")
if(NOT "${ANTLR3C_LIBRARIES}" STREQUAL "")
set(ANTLR3C_FOUND TRUE)
cmake_push_check_state(RESET)
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
cmake_push_check_state(RESET)
else("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(SAVE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
set(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(CMAKE_REQUIRED_INCLUDES ${ANTLR3C_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ANTLR3C_LIBRARIES})
check_function_exists("antlr3StringStreamNew" HAVE_ANTLR_STRING_STREAM_NEW)
cmake_pop_check_state()
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
cmake_pop_check_state()
else("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(CMAKE_REQUIRED_INCLUDES ${SAVE_CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
endif(NOT "${ANTLR3C_LIBRARIES}" STREQUAL "")
endif(NOT "${ANTLR3C_INCLUDE_DIR}" STREQUAL "")
......
......@@ -26,7 +26,9 @@
# POLARSSL_INCLUDE_DIR - the polarssl include directory
# POLARSSL_LIBRARIES - The libraries needed to use polarssl
include(CMakePushCheckState)
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
include(CMakePushCheckState)
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
include(CheckIncludeFile)
include(CheckCSourceCompiles)
......@@ -52,7 +54,12 @@ if(NOT "${POLARSSL_INCLUDE_DIR}" STREQUAL "")
if(NOT "${POLARSSL_LIBRARIES}" STREQUAL "")
set(POLARSSL_FOUND TRUE)
cmake_push_check_state(RESET)
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
cmake_push_check_state(RESET)
else("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(SAVE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
set(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(CMAKE_REQUIRED_INCLUDES ${POLARSSL_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${POLARSSL_LIBRARIES})
check_c_source_compiles("#include <polarssl/version.h>
......@@ -65,7 +72,12 @@ x509parse_crtpath(0,0);
return 0;
}"
X509PARSE_CRTPATH_OK)
cmake_pop_check_state()
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
cmake_pop_check_state()
else("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
set(CMAKE_REQUIRED_INCLUDES ${SAVE_CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES})
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.5")
endif(NOT "${POLARSSL_LIBRARIES}" STREQUAL "")
endif(NOT "${POLARSSL_INCLUDE_DIR}" STREQUAL "")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment