mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
Do not overwrite CMAKE_PREFIX_PATH in component config files.
This fixes problems when a project adds a directory to CMAKE_PREFIX_PATH, then calls find_package(Poco ...) and afterwards calls find_package() for another project located in one of the directories of the original CMAKE_PREFIX_PATH variable.
This commit is contained in:
parent
319e2d80b5
commit
10425a9556
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoCppParserTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoCppParserTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoCryptoTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoCryptoTargets.cmake")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoData)
|
find_dependency(PocoData)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataMySQLTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataMySQLTargets.cmake")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoData)
|
find_dependency(PocoData)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataODBCTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataODBCTargets.cmake")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoData)
|
find_dependency(PocoData)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataSQLiteTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataSQLiteTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoDataTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoJSONTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoJSONTargets.cmake")
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoNet)
|
find_dependency(PocoNet)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoMongoDBTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoMongoDBTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetTargets.cmake")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoUtil)
|
find_dependency(PocoUtil)
|
||||||
find_dependency(PocoNet)
|
find_dependency(PocoNet)
|
||||||
find_dependency(PocoCrypto)
|
find_dependency(PocoCrypto)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetSSLTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetSSLTargets.cmake")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoUtil)
|
find_dependency(PocoUtil)
|
||||||
find_dependency(PocoNet)
|
find_dependency(PocoNet)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetSSLWinTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoNetSSLWinTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoPDFTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoPDFTargets.cmake")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoXML)
|
find_dependency(PocoXML)
|
||||||
find_dependency(PocoUtil)
|
find_dependency(PocoUtil)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoSevenZipTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoSevenZipTargets.cmake")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoXML)
|
find_dependency(PocoXML)
|
||||||
find_dependency(PocoJSON)
|
find_dependency(PocoJSON)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoUtilTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoUtilTargets.cmake")
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
find_dependency(PocoFoundation)
|
find_dependency(PocoFoundation)
|
||||||
find_dependency(PocoUtil)
|
find_dependency(PocoUtil)
|
||||||
find_dependency(PocoXML)
|
find_dependency(PocoXML)
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/PocoZipTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoZipTargets.cmake")
|
||||||
|
@ -21,6 +21,10 @@ get_filename_component(_Poco_install_prefix "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE
|
|||||||
|
|
||||||
set(_Poco_NOTFOUND_MESSAGE)
|
set(_Poco_NOTFOUND_MESSAGE)
|
||||||
|
|
||||||
|
# Let components find each other, but don't overwrite CMAKE_PREFIX_PATH
|
||||||
|
set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH})
|
||||||
|
set(CMAKE_PREFIX_PATH ${_Poco_install_prefix})
|
||||||
|
|
||||||
foreach(module ${Poco_FIND_COMPONENTS})
|
foreach(module ${Poco_FIND_COMPONENTS})
|
||||||
find_package(Poco${module}
|
find_package(Poco${module}
|
||||||
${_Poco_FIND_PARTS_QUIET}
|
${_Poco_FIND_PARTS_QUIET}
|
||||||
@ -39,6 +43,9 @@ foreach(module ${Poco_FIND_COMPONENTS})
|
|||||||
list(APPEND Poco_LIBRARIES "Poco::${module}")
|
list(APPEND Poco_LIBRARIES "Poco::${module}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Restore the original CMAKE_PREFIX_PATH value
|
||||||
|
set(CMAKE_PREFIX_PATH ${_Poco_CMAKE_PREFIX_PATH_old})
|
||||||
|
|
||||||
if (_Poco_NOTFOUND_MESSAGE)
|
if (_Poco_NOTFOUND_MESSAGE)
|
||||||
set(Poco_NOT_FOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}")
|
set(Poco_NOT_FOUND_MESSAGE "${_Poco_NOTFOUND_MESSAGE}")
|
||||||
set(Poco_FOUND False)
|
set(Poco_FOUND False)
|
||||||
|
Loading…
Reference in New Issue
Block a user