Cleanup cmake build system (develop) to use transitive dependency management from cmake (#2322)

* Cleanup cmake Root CMakeLists.txt

* Cleanup cmake targets

* Add find openssl modul for older cmake version

* set proper scope

* Switch off make based builds in travis and appveyor

* Fix build break, set C11 on c file

* Set from C11 to C99

* Fix NetSSL win build

* Set C99 compile features

* Fix Windows build

* Fix windows build

* Revert "Fix windows build"

This reverts commit 678d44216bd964f61655df809efbf63ddd8a7bfd.

* Cleanup poco unbundle definition

* Fix PDF build

* Remove unused set affinity

* Add _AFXDLL as target compile definitions

* Refactor add_definitions to target_compile_definitons in Util

* Refactor add_definitions to target_compile_definitons in XML

* Remove THREADSAFE in data sql cmake build

* Refactor add_definitions to target_compile_definition in cmake mysql

* Refactor add_definitions to target_compile_definition in cmake odbc

* Refactor add_definitions to target_compile_definition in cmake sqlite

* Refactor add_definitions to target_compile_definitions in platform specific cmake

* Add _DEBUG as compile definition

* Add build dependencies between Foundation-testrunner and TestApp, TestLibrary in cmake build

* cleanup LIB_MODE_DEFINITIONS in cmake buld system

* Fix broken merge

* Fix android foundation test

* Fix old redis build version

* Fix android fondation test

* Cleanup target link libraries.

* Update cmake documentation

* Some fixese in crypto and netssl for win and some cleanup an SQL

* Minor fix in root CMakeList.txt

* Squashed commit of the following:

commit df050b56b6d81eaf9bdb37bb016fe9a3554eba4f

    Fix build dependecies in cmake

* Squashed commit of the following:

commit f41ce2bb404e197ff04b1e64f7b66c9a2b1e03c8

    Fix PostgreSQL build

* Squashed commit of the following:

commit b7da0deed67ffff23a8b7a50d6deff1e022b2577

    Set db hostnames

* Update doc

* Update cmake build commands

* Set public on target link libraries in cmake build

* Fix broken cppunit merge
This commit is contained in:
Joerg-Christian Boehme
2018-06-03 18:19:00 +02:00
committed by Aleksandar Fabijanic
parent 89e9d684ef
commit 8a70ab8a1c
137 changed files with 1702 additions and 1305 deletions

View File

@@ -1,6 +1,3 @@
set(LIBNAME "SQLPostgreSQL")
set(POCO_LIBNAME "Poco${LIBNAME}")
# Sources
file(GLOB SRCS_G "src/*.cpp")
POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G})
@@ -9,25 +6,25 @@ POCO_SOURCES_AUTO( POSTGRESQL_SRCS ${SRCS_G})
file(GLOB_RECURSE HDRS_G "include/*.h" )
POCO_HEADERS_AUTO( POSTGRESQL_SRCS ${HDRS_G})
add_library( "${LIBNAME}" ${POSTGRESQL_SRCS} )
add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
set_target_properties( "${LIBNAME}"
add_library(SQLPostgreSQL ${POSTGRESQL_SRCS} )
add_library(Poco::SQLPostgreSQL ALIAS SQLPostgreSQL)
set_target_properties(SQLPostgreSQL
PROPERTIES
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
OUTPUT_NAME ${POCO_LIBNAME}
OUTPUT_NAME PocoSQLPostgreSQL
DEFINE_SYMBOL PostgreSQL_EXPORTS
)
target_link_libraries( "${LIBNAME}" Foundation SQL ${PostgreSQL_LIBRARIES})
target_include_directories( "${LIBNAME}"
target_link_libraries(SQLPostgreSQL PUBLIC Poco::SQL ${PostgreSQL_LIBRARIES})
target_include_directories(SQLPostgreSQL
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
POCO_INSTALL(SQLPostgreSQL)
POCO_GENERATE_PACKAGE(SQLPostgreSQL)
if (POCO_ENABLE_TESTS)
add_subdirectory(testsuite)

View File

@@ -1,5 +1,3 @@
set(TESTUNIT "${LIBNAME}-testrunner")
# Sources
file(GLOB SRCS_G "src/*.cpp")
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
@@ -12,6 +10,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
src/WinDriver.cpp
)
add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoSQLPostgreSQL PocoSQL PocoFoundation CppUnit ${PostgreSQL_LIBRARIES})
add_executable(SQLPostgreSQL-testrunner ${TEST_SRCS} )
add_test(NAME SQLPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND SQLPostgreSQL-testrunner -all)
target_link_libraries(SQLPostgreSQL-testrunner PUBLIC Poco::SQLPostgreSQL Poco::CppUnit)

View File

@@ -50,7 +50,10 @@ std::string PostgreSQLTest::_dbConnString;
// Parameters for barebone-test
//
std::string PostgreSQLTest::getHost() {
return "localhost";
if (Environment::has("POSTGRESQL_HOST"))
return Environment::get("POSTGRESQL_HOST");
else
return "localhost";
}
std::string PostgreSQLTest::getPort() {
return "5432";