Set tinyxml2_LIBRARIES after find_package() (#3918)
If tinyxml2 is found by find_package(), then tinyxml2_LIBRARIES is empty. Set tinyxml2_LIBRARIES to "tinyxml2::tinyxml2" in this case. - Fixes "undefined reference to `tinyxml2::" - printInfo.cmake: Fix indentation of tinyxml2_LIBRARIES
This commit is contained in:
parent
40c2687ac4
commit
3cefba0259
|
@ -47,7 +47,9 @@ endif()
|
|||
|
||||
if (NOT USE_BUNDLED_TINYXML2)
|
||||
find_package(tinyxml2 QUIET)
|
||||
if (NOT tinyxml2_FOUND)
|
||||
if (TARGET tinyxml2::tinyxml2)
|
||||
set(tinyxml2_LIBRARIES "tinyxml2::tinyxml2")
|
||||
else()
|
||||
find_library(tinyxml2_LIBRARIES tinyxml2)
|
||||
if (NOT tinyxml2_LIBRARIES)
|
||||
message(FATAL_ERROR "tinyxml2 has not been found")
|
||||
|
|
Loading…
Reference in New Issue