Try singular name if plural not defined
In CMake "canon" (i.e. tutorial on Kitware's website) it is stated that the _DIR suffix should be used for the directory of the library alone, whereas _DIRS are entire list of paths necessary to compile (i.e. dependencies are included). Eigen3 only uses the singular form (since it doesn't have any dependencies); it should really be copied to the plural form, but it may be advantageous to have the find-module included unchanged, so we put in an extra effort to find it here.
This commit is contained in:
1 parent
6d1b47e419
commit
26475f448b
1 file changed
+4
@@ -158,6 +158,10 @@ macro (find_and_append_package_to prefix name)
|
||||
elseif (DEFINED ${NAME}_INCLUDE_PATH)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${NAME}_INCLUDE_PATH})
|
||||
endif (DEFINED ${name}_INCLUDE_PATH)
|
||||
# some packages define only _DIR and not _DIRS (Hi, Eigen3!)
|
||||
if (NOT DEFINED ${name}_INCLUDE_DIRS)
|
||||
list (APPEND ${prefix}_INCLUDE_DIRS ${${prefix}_INCLUDE_DIR})
|
||||
endif (NOT DEFINED ${name}_INCLUDE_DIRS)
|
||||
endif ("${var}" STREQUAL "INCLUDE_DIRS")
|
||||
# cleanup lists
|
||||
if ("${var}" STREQUAL "LIBRARIES")
|
||||
|
||||
Reference in new issue
Block a user