--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2016 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.
+##
+## ---------------------------------------------------------------------
+
+#
+# Configuration for cuda support:
+#
+
+MACRO(FEATURE_CUDA_FIND_EXTERNAL var)
+ FIND_PACKAGE(CUDA)
+
+ IF(CUDA_FOUND)
+ SET(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE FALSE)
+
+ SET(${var} TRUE)
+ ENDIF()
+
+ENDMACRO()
+
+MACRO(FEATURE_CUDA_ERROR_MESSAGE)
+ MESSAGE(FATAL_ERROR "\n"
+ "Could not find any suitable cuda library!\n"
+ ${CUDA_ADDITIONAL_ERROR_STRING}
+ "\nPlease ensure that a cuda library is installed on your computer\n"
+ )
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(CUDA)
## ---------------------------------------------------------------------
##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2016 by the deal.II authors
##
## This file is part of the deal.II library.
##
SET_PROPERTY(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build}
"$<TARGET_OBJECTS:${_library}.${_build_lowercase}>"
)
+
+ #
+ # Cuda specific target setup:
+ #
+ IF(DEAL_II_WITH_CUDA)
+ CUDA_WRAP_SRCS(${_library}.${_build_lowercase}
+ OBJ _generated_cuda_files ${ARGN} SHARED
+ )
+
+ ADD_CUSTOM_TARGET(${_library}.${_build_lowercase}_cuda
+ DEPENDS
+ ${_generated_cuda_files}
+ )
+ ADD_DEPENDENCIES(${_library}.${_build_lowercase}
+ ${_library}.${_build_lowercase}_cuda
+ )
+
+ SET_PROPERTY(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build}
+ "${_generated_cuda_files}"
+ )
+ ENDIF()
+
ENDFOREACH()
ENDMACRO()
#cmakedefine DEAL_II_WITH_64BIT_INDICES
#cmakedefine DEAL_II_WITH_ARPACK
#cmakedefine DEAL_II_WITH_BZIP2
+#cmakedefine DEAL_II_WITH_CUDA
#cmakedefine DEAL_II_WITH_CXX11
#cmakedefine DEAL_II_WITH_CXX14
#cmakedefine DEAL_II_WITH_GSL
#
GET_PROPERTY(_objects GLOBAL PROPERTY DEAL_II_OBJECTS_${build})
+
+ #
+ # FIXME: Somehow the cuda object files lose the "generated" property.
+ # This is an ugly hack
+ #
+ FOREACH(_object ${_objects})
+ IF("${_object}" MATCHES "cu.o$")
+ SET_SOURCE_FILES_PROPERTIES("${_object}"
+ PROPERTIES
+ EXTERNAL_OBJECT TRUE
+ GENERATED TRUE
+ )
+ ENDIF()
+ ENDFOREACH()
+
ADD_LIBRARY(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
dummy.cc # Workaround for a bug in the Xcode generator
${_objects}