Skip to content
Snippets Groups Projects
Commit 3cfad373 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

cmake: move wrapping settings to its own module

parent 2b0bae20
No related branches found
No related tags found
No related merge requests found
# Configure files with settings for use by the build.
# Add the option for build the Python wrapping to VTK.
option(VTK_WRAP_PYTHON "Should VTK Python wrapping be built?" OFF)
set(VTK_PYTHON_VERSION 2 CACHE STRING
"Python version to use")
set_property(CACHE VTK_PYTHON_VERSION
PROPERTY
STRINGS "2;2.7;3;3.3;3.4;3.5;3.6;3.7;")
# Force reset of hints file location in cache if it was moved
if(VTK_WRAP_HINTS AND NOT EXISTS ${VTK_WRAP_HINTS})
set(VTK_WRAP_HINTS "VTK_WRAP_HINTS-NOTFOUND")
endif()
find_file(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping/Tools
NO_CMAKE_FIND_ROOT_PATH)
mark_as_advanced(VTK_WRAP_HINTS)
if(BUILD_TESTING OR VTK_WRAP_PYTHON)
# Need PYTHON_EXECUTABLE for HeaderTesting or python wrapping
find_package(PythonInterp ${VTK_PYTHON_VERSION} QUIET)
mark_as_advanced(PYTHON_EXECUTABLE)
endif()
if(VTK_WRAP_PYTHON)
set(VTK_WRAP_PYTHON_EXE vtkWrapPython)
set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
endif()
# Force the WrappingPythonCore module to on if wrapping is on
set(Module_vtkWrappingPythonCore ${VTK_WRAP_PYTHON}
CACHE BOOL "Core Python wrapping library" FORCE)
option(VTK_WRAP_JAVA "Should VTK Java wrapping be built?" OFF)
if(VTK_WRAP_JAVA)
set(VTK_WRAP_JAVA3_INIT_DIR "${VTK_SOURCE_DIR}/Wrapping/Java")
# Wrapping executables.
set(VTK_WRAP_JAVA_EXE vtkWrapJava)
set(VTK_PARSE_JAVA_EXE vtkParseJava)
# Java package location.
set(VTK_JAVA_JAR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vtk.jar)
set(VTK_JAVA_HOME ${VTK_BINARY_DIR}/java/vtk)
file(MAKE_DIRECTORY ${VTK_JAVA_HOME})
endif()
set(Module_vtkWrappingJava ${VTK_WRAP_JAVA}
CACHE BOOL "Core Java wrapping library" FORCE)
if(VTK_WRAP_PYTHON OR VTK_WRAP_JAVA OR VTK_WRAP_HIERARCHY)
set(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
endif()
......@@ -26,6 +26,7 @@ include(vtkMobileDevices)
include(vtkCrossCompiling)
include(vtkThirdParty)
include(vtkThreads)
include(vtkWrapSettings)
include(vtkModuleMacros)
......@@ -71,69 +72,6 @@ TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
include(CheckTypeSize)
#-----------------------------------------------------------------------------
# Configure files with settings for use by the build.
# Add the option for build the Python wrapping to VTK.
option(VTK_WRAP_PYTHON "Should VTK Python wrapping be built?" OFF)
set(VTK_PYTHON_VERSION 2 CACHE STRING
"Python version to use: 2, 2.x, 3, 3.x, or empty")
# Add the option for build the Python wrapping to VTK.
option(VTK_WRAP_JAVA "Should VTK Java wrapping be built?" OFF)
# Force reset of hints file location in cache if it was moved
if(VTK_WRAP_HINTS)
if(NOT EXISTS ${VTK_WRAP_HINTS})
set(VTK_WRAP_HINTS "VTK_WRAP_HINTS-NOTFOUND")
endif()
endif()
find_file(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping/Tools
NO_CMAKE_FIND_ROOT_PATH)
mark_as_advanced(VTK_WRAP_HINTS)
if(BUILD_TESTING OR VTK_WRAP_PYTHON)
# Need PYTHON_EXECUTABLE for HeaderTesting or python wrapping
find_package(PythonInterp ${VTK_PYTHON_VERSION} QUIET)
mark_as_advanced(PYTHON_EXECUTABLE)
endif()
if(VTK_WRAP_PYTHON)
set(VTK_WRAP_PYTHON_EXE vtkWrapPython)
set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
# Force the WrappingPythonCore module to on if wrapping is on
set(Module_vtkWrappingPythonCore ON CACHE BOOL "Core Python wrapping library"
FORCE)
else()
# if wrapping is not on then force WrappingPythonCore module to be off
set(Module_vtkWrappingPythonCore OFF CACHE BOOL "Core Python wrapping library"
FORCE)
endif()
if(VTK_WRAP_JAVA)
set(VTK_WRAP_JAVA3_INIT_DIR "${VTK_SOURCE_DIR}/Wrapping/Java")
# Wrapping executables.
set(VTK_WRAP_JAVA_EXE vtkWrapJava)
set(VTK_PARSE_JAVA_EXE vtkParseJava)
set(Module_vtkWrappingJava ON CACHE BOOL "Core Java wrapping library"
FORCE)
# Java package location.
set(VTK_JAVA_JAR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vtk.jar)
set(VTK_JAVA_HOME ${VTK_BINARY_DIR}/java/vtk)
file(MAKE_DIRECTORY ${VTK_JAVA_HOME})
else()
set(Module_vtkWrappingJava OFF CACHE BOOL "Core Java wrapping library"
FORCE)
endif()
option(VTK_WRAP_HIERARCHY "Create wrap hierarchy even if languages are disabled." OFF)
mark_as_advanced(VTK_WRAP_HIERARCHY)
if(VTK_WRAP_PYTHON OR VTK_WRAP_JAVA OR VTK_WRAP_HIERARCHY)
set(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
endif()
# Kits bundle multiple modules together into a single library, this
# is used to dramatically reduce the number of generated libraries.
option(VTK_ENABLE_KITS "Build VTK using kits instead of modules." OFF)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment