# Determine the Endianess of the platform:
#
IF(CMAKE_C_COMPILER_WORKS)
- SET(CMAKE_REQUIRED_FLAGS)
- SET(CMAKE_REQUIRED_INCLUDES)
- SET(CMAKE_REQUIRED_LIBRARIES)
-
INCLUDE(TestBigEndian)
- TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN)
+ CLEAR_CMAKE_REQUIRED()
+ TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN)
RESET_CMAKE_REQUIRED()
ELSE()
MESSAGE(STATUS
# Do this unconditionally for the most common case:
# TODO: Non-GNU setups...
#
- #
# Switch the library preference back to prefer dynamic libraries if
# DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In
# this case system libraries should be linked dynamically.
)
MACRO(CHECK_FOR_LAPACK_FUNCTIONS)
- LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
- ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+ #
+ # Clear the test flags because the following test will use a C compiler
+ #
+ CLEAR_CMAKE_REQUIRED()
+ SET(CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+ SET(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
#
# Push -pthread as well:
#
# this case system libraries should be linked dynamically.
#
SWITCH_LIBRARY_PREFERENCE()
+
+ #
+ # Clear the test flags because FindThreads.cmake will use a C compiler:
+ #
+ CLEAR_CMAKE_REQUIRED()
+
FIND_PACKAGE(Threads)
+
+ RESET_CMAKE_REQUIRED()
SWITCH_LIBRARY_PREFERENCE()
ELSE()
--- /dev/null
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# A small macro to clear the CMAKE_REQUIRED_* variables.
+#
+# Usage:
+# CLEAR_CMAKE_REQUIRED_FLAGS
+#
+
+MACRO(CLEAR_CMAKE_REQUIRED)
+ SET(CMAKE_REQUIRED_FLAGS)
+ SET(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_REQUIRED_LIBRARIES)
+ENDMACRO()
+