Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Enable forcing build from source, and pass through c++ flags #24

Merged
merged 3 commits into from
Mar 21, 2019
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
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ project(poco_vendor VERSION "1.1.1")

# Can work with poco 1.4.1p1 (earliest to use recursive mutexes on Linux)
# 1.6.1 is the first version to ship with PocoConfigVersion.cmake
find_package(Poco "1.6.1" COMPONENTS Foundation QUIET)
if(NOT FORCE_BUILD_POCO)
nuclearsandwich marked this conversation as resolved.
Show resolved Hide resolved
find_package(Poco "1.6.1" COMPONENTS Foundation QUIET)
emersonknapp marked this conversation as resolved.
Show resolved Hide resolved
endif()


if(NOT Poco_FOUND)
set(POCO_CXX_FLAGS ${CMAKE_CXX_FLAGS})

# If Poco was not found, download and build from source
if(DEFINED CMAKE_BUILD_TYPE)
list(APPEND extra_cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
if(WIN32)
list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=/wd4244 /wd4530 /wd4577")
list(APPEND POCO_CXX_FLAGS "/wd4244 /wd4530 /wd4577")
else()
list(APPEND extra_cmake_args "-DCMAKE_C_FLAGS=-Wno-shift-negative-value")
list(APPEND extra_cmake_args "-DCMAKE_CXX_STANDARD=14")
Expand Down Expand Up @@ -46,6 +51,9 @@ if(NOT Poco_FOUND)
endif()
endif()
endif()
list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=${POCO_CXX_FLAGS}")
list(APPEND extra_cmake_args "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
list(APPEND extra_cmake_args "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
include(ExternalProject)

ExternalProject_Add(poco-1.8.0.1-release
Expand Down