poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
This commit is contained in:
Matwey V. Kornilov 2020-07-04 13:58:53 +03:00
parent 338e772393
commit 20c8e22942

View File

@ -24,7 +24,7 @@ if (ENABLE_ODBC)
target_include_directories (_poco_data_odbc SYSTEM PUBLIC ${LIBRARY_DIR}/Data/ODBC/include)
target_link_libraries (_poco_data_odbc PUBLIC Poco::Data unixodbc)
else ()
add_library (Poco::Data::ODBC UNKNOWN IMPORTED)
add_library (Poco::Data::ODBC UNKNOWN IMPORTED GLOBAL)
find_library(LIBRARY_POCO_DATA_ODBC PocoDataODBC)
find_path(INCLUDE_POCO_DATA_ODBC Poco/Data/ODBC/ODBC.h)