# #
########################################################################
-#
-# Some black magic to have substitution in command names:
-#
-MACRO(RUN_COMMAND _the_command)
- FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/macro_configure_feature.tmp"
- "${_the_command}")
- INCLUDE("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/macro_configure_feature.tmp")
-ENDMACRO()
-
#
# A small macro to set the DEAL_II_WITH_${_feature} variables:
PURGE_FEATURE(${_feature})
IF(FEATURE_${_feature}_HAVE_BUNDLED)
- RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
+ EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
SET_CACHED_OPTION(${_feature} ON)
# Second case: We are allowed to search for an external library
#
IF(COMMAND FEATURE_${_feature}_FIND_EXTERNAL)
- RUN_COMMAND("FEATURE_${_feature}_FIND_EXTERNAL(FEATURE_${_feature}_EXTERNAL_FOUND)")
+ EVALUATE_EXPRESSION("FEATURE_${_feature}_FIND_EXTERNAL(FEATURE_${_feature}_EXTERNAL_FOUND)")
ELSE()
FEATURE_FIND_EXTERNAL(${_feature} FEATURE_${_feature}_EXTERNAL_FOUND)
ENDIF()
IF(FEATURE_${_feature}_EXTERNAL_FOUND)
IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL)
- RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()")
+ EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_EXTERNAL()")
ENDIF()
MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
MESSAGE(STATUS "DEAL_II_WITH_${_feature} has unmet external dependencies.")
IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED)
- RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
+ EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
ELSE()
IF(DEAL_II_WITH_${_feature})
IF(COMMAND FEATURE_${_feature}_ERROR_MESSAGE)
- RUN_COMMAND("FEATURE_${_feature}_ERROR_MESSAGE()")
+ EVALUATE_EXPRESSION("FEATURE_${_feature}_ERROR_MESSAGE()")
ELSE()
FEATURE_ERROR_MESSAGE(${_feature})
ENDIF()
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2012 - 2017 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 macro that evaluates an expression as supplied by a string. Suggestion
+# from the Wiki http://cmake.org/Wiki/CMake/Language_Syntax
+#
+# USAGE:
+#
+# EVALUATE_EXPRESSION("<expression>")
+#
+
+MACRO(EVALUATE_EXPRESSION _the_expression)
+ SET(_tmp_name
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/evaluate_expression.tmp"
+ )
+ FILE(WRITE ${_tmp_name} "${_the_expression}")
+ INCLUDE("${_tmp_name}")
+ENDMACRO()