Skip to content

Commit 17ba86f

Browse files
committed
BUG: Address issues related to ITK update to modern interfaces
Recent changes to ITK have been made to use CMake interfaces over raw libraries and files, along with adding the ITK namespace to targets: See InsightSoftwareConsortium/ITK#5721 This change consistently uses the proxTV namespace for compatibility between uses of the proxTV.
1 parent 97587e4 commit 17ba86f

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
cmake_minimum_required(VERSION 3.16.2)
22
project(TotalVariation)
33

4-
if(ITK_USE_SYSTEM_proxTV)
5-
set(TotalVariation_LIBRARIES proxTV::proxTV)
6-
else()
7-
set(TotalVariation_LIBRARIES proxTV)
8-
endif()
94

10-
set(${PROJECT_NAME}_THIRD_PARTY 1)
5+
set(TotalVariation_LIBRARIES proxTV::proxTV)
6+
117

128
include(itk-module-init.cmake)
139

@@ -53,12 +49,9 @@ else()
5349
add_compile_definitions(PROXTV_USE_LAPACK)
5450
endif()
5551

56-
# _proxTV_lib will be `proxTV::proxTV` when find_package, and `proxTV` when add_subdirectory(proxTV_folder)
57-
set(_proxTV_lib "")
5852
# if proxTV is built elsewhere
5953
if(ITK_USE_SYSTEM_proxTV)
6054
find_package(proxTV REQUIRED CONFIG)
61-
set(_proxTV_lib proxTV::proxTV)
6255
set(proxTV_DIR_INSTALL ${proxTV_DIR})
6356
set(proxTV_DIR_BUILD ${proxTV_DIR})
6457
# It is only needed to EXPORT_CODE_BUILD when using external proxTV
@@ -110,12 +103,12 @@ else() # build proxTV here with the selected Eigen3
110103
endif()
111104
set(proxTV_INSTALL_CMAKE_DIR ${ITK_INSTALL_PACKAGE_DIR}/Modules)
112105
endif()
106+
#set(proxTV_INSTALL_DEVELOPMENT OFF)
113107
# end proxTV options
114108

115109
FetchContent_MakeAvailable(proxTV_fetch)
116110
# proxTV will generate a target proxTV::proxTV when using find_package,
117-
# or a library proxTV when using add_subdirectory
118-
set(_proxTV_lib proxTV) # proxTV generated in subdirectory
111+
119112
set(proxTV_DIR_INSTALL "${CMAKE_INSTALL_PREFIX}/${proxTV_INSTALL_CMAKE_DIR}")
120113
endif()
121114

@@ -130,7 +123,7 @@ find_package(proxTV REQUIRED CONFIG)
130123
set(_populate_include_dirs_for_swig TRUE)
131124
if(${_populate_include_dirs_for_swig})
132125
# SWIG (wrapping) requires INCLUDE_DIRS
133-
get_target_property(proxTV_INCLUDE_DIRS ${_proxTV_lib} INTERFACE_INCLUDE_DIRECTORIES)
126+
get_target_property(proxTV_INCLUDE_DIRS proxTV::proxTV INTERFACE_INCLUDE_DIRECTORIES)
134127
string(REGEX REPLACE
135128
".*BUILD_INTERFACE:(.*/proxtv_fetch-build/src/include).*"
136129
"\\1"
@@ -151,5 +144,3 @@ else()
151144
endif()
152145

153146

154-
# Add the proxTV library to Modules/Targets/TotalVariationTargets.cmake
155-
itk_module_target(${_proxTV_lib} NO_INSTALL)

0 commit comments

Comments
 (0)