Commit a982cf46 authored by Matthew Woehlke's avatar Matthew Woehlke
Browse files

Support third-party modules that use CamelCase

Add logic to third-party 'module' support to also work with external
packages that use CamelCase for their package "standard" variables (i.e.
<name>_{FOUND,LIBRARIES,INCLUDE_DIRS}). In particular, ParaView requires
this to use external QtTesting.

Change-Id: I645d2374ec2503eac7d226ef948f6f4b01f8de01
parent 673e42df
...@@ -631,15 +631,21 @@ macro(vtk_module_third_party _pkg) ...@@ -631,15 +631,21 @@ macro(vtk_module_third_party _pkg)
endif() endif()
endif() endif()
find_package(${_pkg} REQUIRED ${__extra_args}) find_package(${_pkg} REQUIRED ${__extra_args})
if(NOT ${_upper}_FOUND) if(NOT ${_upper}_FOUND AND NOT ${_pkg}_FOUND)
message(FATAL_ERROR "VTK_USE_SYSTEM_${_upper} is ON but ${_pkg} is not found!") message(FATAL_ERROR "VTK_USE_SYSTEM_${_upper} is ON but ${_pkg} is not found!")
endif() endif()
if(${_upper}_INCLUDE_DIRS) if(${_pkg}_INCLUDE_DIRS)
set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_pkg}_INCLUDE_DIRS})
elseif(${_upper}_INCLUDE_DIRS)
set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIRS}) set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIRS})
else() else()
set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIR}) set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIR})
endif() endif()
set(vtk${_lower}_LIBRARIES "${${_upper}_LIBRARIES}") if(${_pkg}_LIBRARIES)
set(vtk${_lower}_LIBRARIES "${${_pkg}_LIBRARIES}")
else()
set(vtk${_lower}_LIBRARIES "${${_upper}_LIBRARIES}")
endif()
set(vtk${_lower}_INCLUDE_DIRS "") set(vtk${_lower}_INCLUDE_DIRS "")
else() else()
if(_nolibs) if(_nolibs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment