1+ # SPDX-FileCopyrightText: The Eigen Authors
2+ # SPDX-License-Identifier: MPL-2.0
3+
14# Same version of ITK cmake_minimum_required
2- cmake_minimum_required (VERSION 3.10.2 )
5+ cmake_minimum_required (VERSION 3.16.3 )
36
47project (Eigen3)
58
69# ITK doesn't compile anything here, just generates targets for the INTERFACE library.
7- if ( FALSE )
10+ #[[ # ITK - START DISABLE UPSTREAM EIGEN LOGIC
811
912cmake_minimum_required(VERSION 3.10.0)
1013
@@ -828,7 +831,7 @@ message(STATUS "")
828831message(STATUS "Configured Eigen ${EIGEN_VERSION_STRING}")
829832message(STATUS "")
830833
831- endif () # Regular CMakeLists of Eigen ends here
834+ # ]] # ITK -STOP DISABLE UPSTREAM EIGEN LOGIC
832835
833836###############################################################################
834837################################ ITK ##########################################
@@ -949,8 +952,7 @@ add_library (ITKInternalEigen3::Eigen ALIAS eigen_internal)
949952# This would wrongly enforce EIGEN_MPL2_ONLY to other libraries using Eigen.
950953# We wrap this definition in ITK_USE_EIGEN_MPL2_ONLY, and only enabling it internally in the dashboards and CI,
951954# to avoid introducing GPL code from Eigen3 internally in ITK.
952- option (ITK_USE_EIGEN_MPL2_ONLY "Set compile definition EIGEN_MPL2_ONLY for ITKInternalEigen3." OFF )
953- mark_as_advanced (ITK_USE_EIGEN_MPL2_ONLY )
955+ # (ITK_USE_EIGEN_MPL2_ONLY is declared once near line 844 of this file.)
954956
955957if (ITK_USE_EIGEN_MPL2_ONLY)
956958 target_compile_definitions (eigen_internal INTERFACE "EIGEN_MPL2_ONLY" )
@@ -961,12 +963,15 @@ endif()
961963# INSTALL: headers require pre-prend itkeigen/Eigen/X.
962964target_include_directories (eigen_internal SYSTEM INTERFACE
963965 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /..>
964- # $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
965966 $<INSTALL_INTERFACE :${INCLUDE_INSTALL_DIR} >
966967 )
967968
968969# Export as title case Eigen
969970set_target_properties (eigen_internal PROPERTIES EXPORT_NAME Eigen )
971+ # Issue InsightSoftwareConsortium/ITK#6239: ship eigen_internal in ITKTargets.cmake when building inside ITK.
972+ if (DEFINED ITK3P_INSTALL_EXPORT_NAME)
973+ install (TARGETS eigen_internal EXPORT ${ITK3P_INSTALL_EXPORT_NAME} )
974+ endif ()
970975install (TARGETS eigen_internal EXPORT ITKInternalEigen3Targets)
971976
972977set (EIGEN3_TARGETS_FILE ITKInternalEigen3Targets.cmake)
0 commit comments