Skip to content
This repository was archived by the owner on Jul 1, 2021. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions cmake/Modules/FindPoco.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,35 @@ endif()
# Assume we didn't find it.
set(Poco_FOUND 0)

# check if found Poco version is at least version 1.4.1p1
# since older versions don't use recursive mutexes (on Linux)
if(Poco_INCLUDE_DIR)
find_file (
Poco_VERSION_FILE NAMES "Version.h"
PATHS "${Poco_INCLUDE_DIR}"
PATH_SUFFIXES "Poco" "Foundation/include/Poco"
DOC "Path of Poco/Version.h file"
NO_DEFAULT_PATH
)
if(NOT Poco_VERSION_FILE)
message(STATUS "Found Poco version (< 1.4.0) is too old, building from source instead")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this version file was added in 1.3.7, can you clarify how you picked "1.4.0" for the printed message?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHANGELOG lists the addition in the "Release 1.4.0" section. That is where I got the version number from. Also I don't see any listing of a version 1.3.7 (neither in the changelog nor as a tag).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I guess they had a branch for it but didnt ever released 1.3.7 and several commits on that branch say "preparing for 1.4.0". Sorry for the noise

unset(Poco_INCLUDE_DIR CACHE)
else()
file(
STRINGS "${Poco_VERSION_FILE}" Poco_VERSION_DEFINE
REGEX "#define POCO_VERSION 0x[0-9]+")
if(NOT Poco_VERSION_DEFINE)
message(FATAL_ERROR "Failed to find '#define POCO_VERSION 0x...' in '${Poco_VERSION_FILE}'")
endif()
string(SUBSTRING "${Poco_VERSION_DEFINE}" 21 -1 Poco_VERSION_OCT)
if("${Poco_VERSION_OCT}" STRLESS "0x01040101")
# Poco is too old, build from source instead
message(STATUS "Found Poco version ${Poco_VERSION_OCT} is too old, building from source instead")
unset(Poco_INCLUDE_DIR CACHE)
endif()
endif()
endif()

# Now try to get the include and library path.
if(Poco_INCLUDE_DIR)
if(EXISTS "${Poco_INCLUDE_DIR}/Foundation/include/Poco/SharedLibrary.h")
Expand Down