Skip to content
Snippets Groups Projects
Verified Commit 894acce1 authored by Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin
Browse files

cmake: Import VTKCompileTools if CROSSCOMPILING_EMULATOR support is incomplete

parent d0f83dfe
No related tags found
No related merge requests found
Pipeline #
......@@ -248,6 +248,13 @@ if(NOT VTK_BUILD_PYTHON_MODULE_DIR)
PATH "Directory where python modules will be put inside the build tree")
mark_as_advanced(VTK_BUILD_PYTHON_MODULE_DIR)
endif()
# Full functional CMAKE_CROSSCOMPILING_EMULATOR support for custom_command and
# custom_target is available in CMake 3.8.0
# It was first added in CMake 3.6.0 and later fixed in CMake 3.8.0 (commit e7480d67, CMake issue #16288)
set(_crosscompiling_emulator_support_custom_target 1)
if(CMAKE_VERSION VERSION_LESS 3.8.0)
set(_crosscompiling_emulator_support_custom_target 0)
endif()
# Maintain backward compatibility with user setting COMPILE_TOOLS_IMPORTED
if(DEFINED COMPILE_TOOLS_IMPORTED AND NOT DEFINED VTK_COMPILE_TOOLS_IMPORTED)
set(VTK_COMPILE_TOOLS_IMPORTED ${COMPILE_TOOLS_IMPORTED})
......@@ -256,7 +263,11 @@ endif()
if(NOT DEFINED VTK_COMPILE_TOOLS_IMPORTED)
set(VTK_COMPILE_TOOLS_IMPORTED FALSE)
endif()
if(CMAKE_CROSSCOMPILING AND NOT VTK_COMPILE_TOOLS_IMPORTED AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
if(CMAKE_CROSSCOMPILING
AND NOT VTK_COMPILE_TOOLS_IMPORTED
AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR
AND NOT _crosscompiling_emulator_support_custom_target
)
# if CMAKE_CROSSCOMPILING is true and crosscompiling emulator is not available, we need
# to import build-tools targets.
find_package(VTKCompileTools REQUIRED)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment