From 23b435d0316213c652f2062eb014245eca49749b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 4 Sep 2015 11:41:39 -0400 Subject: [PATCH] Update VTK-m to export to Configure.h if we have opengl interop enabled. At the same time I rearranged the CMakeLists.txt so that the configuration for Configure.h is later so that it catches all CMake Variables. --- CMakeLists.txt | 39 ++++++++++++++++++++---------------- vtkm/internal/Configure.h.in | 4 ++-- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 179dbda8c..4bad4198c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,23 +141,6 @@ check_type_size(int VTKm_SIZE_INT BUILTIN_TYPES_ONLY) check_type_size(long VTKm_SIZE_LONG BUILTIN_TYPES_ONLY) check_type_size("long long" VTKm_SIZE_LONG_LONG BUILTIN_TYPES_ONLY) -#----------------------------------------------------------------------------- -# Build the configure file. -# need to set VTKM_USE_DOUBLE_PRECISION, and VTKM_USE_64BIT_IDS as that -# is the spelling we use for our defines. -set(VTKM_USE_DOUBLE_PRECISION ${VTKm_USE_DOUBLE_PRECISION}) -set(VTKM_USE_64BIT_IDS ${VTKm_USE_64BIT_IDS}) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkm/internal/Configure.h.in - ${CMAKE_CURRENT_BINARY_DIR}/vtkm/internal/Configure.h - @ONLY) -vtkm_install_headers( - vtkm/internal ${CMAKE_CURRENT_BINARY_DIR}/vtkm/internal/Configure.h) - -unset(VTKM_USE_DOUBLE_PRECISION) -unset(VTKM_USE_64BIT_IDS) - - #----------------------------------------------------------------------------- # Find OpenGL and GLEW, if both are found we can enable # the OpenGL Interop support. We use @@ -182,6 +165,9 @@ CMAKE_DEPENDENT_OPTION(VTKm_ENABLE_OPENGL_TESTS "Enable OpenGL Interop Render Window Tests" ON "VTKm_ENABLE_OPENGL_INTEROP;GLUT_FOUND" OFF) +#----------------------------------------------------------------------------- +# Find Pyexpander in case somebody wants to update the auto generated +# faux variadic template code find_package(Pyexpander) #----------------------------------------------------------------------------- @@ -201,6 +187,25 @@ if(VTKm_BUILD_EXAMPLES) add_subdirectory(examples) endif(VTKm_BUILD_EXAMPLES) +#----------------------------------------------------------------------------- +# Build the configure file. +# need to set numerous VTKm cmake properties to the naming convention +# that we exepect for our C++ defines. + +set(VTKM_USE_DOUBLE_PRECISION ${VTKm_USE_DOUBLE_PRECISION}) +set(VTKM_USE_64BIT_IDS ${VTKm_USE_64BIT_IDS}) +set(VTKM_ENABLE_OPENGL_INTEROP ${VTKm_ENABLE_OPENGL_INTEROP}) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkm/internal/Configure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkm/internal/Configure.h + @ONLY) +vtkm_install_headers( + vtkm/internal ${CMAKE_CURRENT_BINARY_DIR}/vtkm/internal/Configure.h) + +unset(VTKM_ENABLE_OPENGL_INTEROP) +unset(VTKM_USE_64BIT_IDS) +unset(VTKM_USE_DOUBLE_PRECISION) + #----------------------------------------------------------------------------- # Configuration for build directory. set(VTKm_INCLUDE_DIRS_CONFIG "${VTKm_SOURCE_DIR};${VTKm_BINARY_DIR}") diff --git a/vtkm/internal/Configure.h.in b/vtkm/internal/Configure.h.in index a33140d33..a28ff1f57 100644 --- a/vtkm/internal/Configure.h.in +++ b/vtkm/internal/Configure.h.in @@ -132,8 +132,8 @@ #endif //Mark if we are building with interop enabled -#ifndef VTKm_ENABLE_OPENGL_INTEROP -#cmakedefine VTKm_ENABLE_OPENGL_INTEROP +#ifndef VTKM_ENABLE_OPENGL_INTEROP +#cmakedefine VTKM_ENABLE_OPENGL_INTEROP #endif // Determine whether we will use variadic templates (a new feature in C++11).