Skip to content

Commit aee8abe

Browse files
jcfrhjmjohnson
authored andcommitted
COMP: Ensure proxTV dependencies are found when building against ITK build tree
This issue was discovered in the following context: * ITK configured with Module_TotalVariation:BOOL=ON * OpenMP installed on the system: This means proxTV depends on OpenMP * ITK used from a build tree Error reported was the following: CMake Error at /path/to/project-build/SlicerExecutionModel-build/CMake/SEMMacroBuildCLI.cmake:159 (add_executable): Target "AwesomeModule" links to target "OpenMP::OpenMP_CXX" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): Modules/AwesomeModule/CMakeLists.txt:46 (SEMMacroBuildCLI)
1 parent fbab387 commit aee8abe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ else(ITK_USE_SYSTEM_proxTV) # build proxTV here with the selected Eigen3
9797
# or a library proxTV when using add_subdirectory
9898
set(_proxTV_lib proxTV) # proxTV generated in subdirectory
9999
set(proxTV_DIR_INSTALL "\${ITK_MODULES_DIR}/../proxTV")
100+
101+
# When this module is loaded by an app, load proxTV too.
102+
set(${PROJECT_NAME}_EXPORT_CODE_BUILD
103+
"${${PROJECT_NAME}_EXPORT_CODE_BUILD}
104+
set(proxTV_DIR \"${proxtv_fetch_BINARY_DIR}\")
105+
find_package(proxTV REQUIRED CONFIG)
106+
")
100107
endif(ITK_USE_SYSTEM_proxTV)
101108

102109
# When this module is loaded by an app, load proxTV too.

0 commit comments

Comments
 (0)