From 129f21cc794093d5222fdf4bf1b04d0fc8367080 Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Thu, 19 Feb 2009 20:35:03 +0000 Subject: [PATCH] added Data, Foundation, Net and Util samples + some global cmake fixes --- Crypto/CMakeLists.txt | 6 ++- Data/CMakeLists.txt | 1 + Data/SQLite/CMakeLists.txt | 4 +- Foundation/CMakeLists.txt | 3 ++ Net/CMakeLists.txt | 92 ++--------------------------------- Util/CMakeLists.txt | 1 + Util/testsuite/CMakeLists.txt | 35 +++++++++++++ contrib/cmake/FindMySQL.cmake | 4 +- contrib/cmake/FindODBC.cmake | 10 ++-- 9 files changed, 57 insertions(+), 99 deletions(-) create mode 100644 Util/testsuite/CMakeLists.txt diff --git a/Crypto/CMakeLists.txt b/Crypto/CMakeLists.txt index 921581d13..3c540573e 100644 --- a/Crypto/CMakeLists.txt +++ b/Crypto/CMakeLists.txt @@ -10,14 +10,14 @@ set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAME} ssl crypto) +target_link_libraries( ${LIBNAME} PocoNetSSL PocoNet ssl crypto) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}" VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAMED} ssl crypto) +target_link_libraries( ${LIBNAMED} PocoNetSSLd PocoNetd ssl crypto) install( DIRECTORY include/Poco @@ -28,3 +28,5 @@ install( TARGETS ${LIBNAME} ${LIBNAMED} DESTINATION lib ) + +add_subdirectory(samples) diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index 04d0df4a0..d9f3504ab 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -36,4 +36,5 @@ if(ODBC_CONFIG) # add_subdirectory( ODBC ) endif(ODBC_CONFIG) +add_subdirectory( samples ) #add_subdirectory( testsuite ) diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt index 8bd43ed9e..5038f1d89 100644 --- a/Data/SQLite/CMakeLists.txt +++ b/Data/SQLite/CMakeLists.txt @@ -13,14 +13,14 @@ set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAME} PocoData ) +target_link_libraries( ${LIBNAME} PocoData PocoFoundation) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}" VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAMED} PocoDatad ) +target_link_libraries( ${LIBNAMED} PocoDatad PocoFoundationd ) install( DIRECTORY include/Poco diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index 9ecb94282..f01dedb27 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -131,6 +131,8 @@ set( BASE_SRCS src/UUIDGenerator.cpp src/Unicode.cpp src/UnicodeConverter.cpp + src/Var.cpp + src/VarHolder.cpp src/Void.cpp src/Windows1252Encoding.cpp src/adler32.c @@ -207,4 +209,5 @@ install( DESTINATION lib ) +add_subdirectory( samples ) #add_subdirectory( testsuite ) diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index afbb46c4c..7d06ae178 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -1,92 +1,7 @@ set(LIBNAME "PocoNet") set(LIBNAMED "${LIBNAME}d") -set( BASE_SRCS -src/AbstractHTTPRequestHandler.cpp -src/DNS.cpp -src/DatagramSocket.cpp -src/DatagramSocketImpl.cpp -src/DialogSocket.cpp -src/FTPClientSession.cpp -src/FTPStreamFactory.cpp -src/FilePartSource.cpp -src/HTMLForm.cpp -src/HTTPBasicCredentials.cpp -src/HTTPBufferAllocator.cpp -src/HTTPChunkedStream.cpp -src/HTTPClientSession.cpp -src/HTTPCookie.cpp -src/HTTPFixedLengthStream.cpp -src/HTTPHeaderStream.cpp -src/HTTPIOStream.cpp -src/HTTPMessage.cpp -src/HTTPRequest.cpp -src/HTTPRequestHandler.cpp -src/HTTPRequestHandlerFactory.cpp -src/HTTPResponse.cpp -src/HTTPServer.cpp -src/HTTPServerConnection.cpp -src/HTTPServerConnectionFactory.cpp -src/HTTPServerParams.cpp -src/HTTPServerRequest.cpp -src/HTTPServerRequestImpl.cpp -src/HTTPServerResponse.cpp -src/HTTPServerResponseImpl.cpp -src/HTTPServerSession.cpp -src/HTTPSession.cpp -src/HTTPSessionFactory.cpp -src/HTTPSessionInstantiator.cpp -src/HTTPStream.cpp -src/HTTPStreamFactory.cpp -src/HostEntry.cpp -src/ICMPClient.cpp -src/ICMPEventArgs.cpp -src/ICMPPacket.cpp -src/ICMPPacketImpl.cpp -src/ICMPSocket.cpp -src/ICMPSocketImpl.cpp -src/ICMPv4PacketImpl.cpp -src/IPAddress.cpp -src/MailMessage.cpp -src/MailRecipient.cpp -src/MailStream.cpp -src/MediaType.cpp -src/MessageHeader.cpp -src/MulticastSocket.cpp -src/MultipartReader.cpp -src/MultipartWriter.cpp -src/NameValueCollection.cpp -src/NetException.cpp -src/NetworkInterface.cpp -src/NullPartHandler.cpp -src/POP3ClientSession.cpp -src/PartHandler.cpp -src/PartSource.cpp -src/QuotedPrintableDecoder.cpp -src/QuotedPrintableEncoder.cpp -src/RawSocket.cpp -src/RawSocketImpl.cpp -src/RemoteSyslogChannel.cpp -src/RemoteSyslogListener.cpp -src/SMTPClientSession.cpp -src/ServerSocket.cpp -src/ServerSocketImpl.cpp -src/Socket.cpp -src/SocketAddress.cpp -src/SocketImpl.cpp -src/SocketNotification.cpp -src/SocketNotifier.cpp -src/SocketReactor.cpp -src/SocketStream.cpp -src/StreamSocket.cpp -src/StreamSocketImpl.cpp -src/StringPartSource.cpp -src/TCPServer.cpp -src/TCPServerConnection.cpp -src/TCPServerConnectionFactory.cpp -src/TCPServerDispatcher.cpp -src/TCPServerParams.cpp -) +aux_source_directory(src BASE_SRCS) set( WIN_SRCS ) @@ -109,14 +24,14 @@ set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAME} ) +target_link_libraries( ${LIBNAME} PocoFoundation) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}" VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) -target_link_libraries( ${LIBNAMED} ) +target_link_libraries( ${LIBNAMED} PocoFoundationd) install( DIRECTORY include/Poco @@ -128,4 +43,5 @@ install( DESTINATION lib ) +add_subdirectory( samples ) #add_subdirectory( testsuite ) diff --git a/Util/CMakeLists.txt b/Util/CMakeLists.txt index 18734c506..9c5e5854a 100644 --- a/Util/CMakeLists.txt +++ b/Util/CMakeLists.txt @@ -65,3 +65,4 @@ install( ) add_subdirectory( testsuite ) +add_subdirectory( samples ) diff --git a/Util/testsuite/CMakeLists.txt b/Util/testsuite/CMakeLists.txt new file mode 100644 index 000000000..791e5cc92 --- /dev/null +++ b/Util/testsuite/CMakeLists.txt @@ -0,0 +1,35 @@ +set( TEST_SRCS +src/AbstractConfigurationTest.cpp +src/ConfigurationMapperTest.cpp +src/ConfigurationTestSuite.cpp +src/ConfigurationViewTest.cpp +src/Driver.cpp +src/FilesystemConfigurationTest.cpp +src/HelpFormatterTest.cpp +src/IniFileConfigurationTest.cpp +src/LayeredConfigurationTest.cpp +src/LoggingConfiguratorTest.cpp +src/MapConfigurationTest.cpp +src/OptionProcessorTest.cpp +src/OptionSetTest.cpp +src/OptionTest.cpp +src/OptionsTestSuite.cpp +src/PropertyFileConfigurationTest.cpp +src/SystemConfigurationTest.cpp +src/UtilTestSuite.cpp +src/ValidatorTest.cpp +src/XMLConfigurationTest.cpp +) + +set( WIN_TEST_SRCS +src/WinConfigurationTest.cpp +src/WinDriver.cpp +src/WinRegistryTest.cpp +src/WindowsTestSuite.cpp +) + +set(TESTUNIT "${LIBNAME}-testrunner") + +add_executable( ${TESTUNIT} ${TEST_SRCS} ) +set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${TESTUNIT} PocoUtil PocoXML PocoFoundation CppUnit pthread) diff --git a/contrib/cmake/FindMySQL.cmake b/contrib/cmake/FindMySQL.cmake index 36daedea6..62f5d76a8 100644 --- a/contrib/cmake/FindMySQL.cmake +++ b/contrib/cmake/FindMySQL.cmake @@ -47,11 +47,9 @@ endif(MYSQL_LIB) if (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR) set(MYSQL_FOUND TRUE) - message(STATUS "MySQL Include directory: ${MYSQL_INCLUDE_DIR} library directory: ${MYSQL_LIB_DIR}") - include_directories(${MYSQL_INCLUDE_DIR}) link_directories(${MYSQL_LIB_DIR}) else (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR) - message(WARNING "Cannot find MySQL, include directory: ${MYSQL_INCLUDE_DIR} library directory: ${MYSQL_LIB_DIR}") + message(STATUS "Cannot find MySQL, include directory: ${MYSQL_INCLUDE_DIR} library directory: ${MYSQL_LIB_DIR}") endif (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR) diff --git a/contrib/cmake/FindODBC.cmake b/contrib/cmake/FindODBC.cmake index 5d5509cba..675a4fa19 100644 --- a/contrib/cmake/FindODBC.cmake +++ b/contrib/cmake/FindODBC.cmake @@ -3,8 +3,8 @@ if(WITH_UNIXODBC) find_program(ODBC_CONFIG odbc_config $ENV{ODBC_PATH}/bin PATHS) if(NOT ODBC_CONFIG) - message(FATAL_ERROR "Couldn't find unixODBC") - endif(NOT ODBC_CONFIG) + message(STATUS "Couldn't find unixODBC") + else(NOT ODBC_CONFIG) message(STATUS "unixODBC: Found odbc_config in ${ODBC_CONFIG}") @@ -12,14 +12,15 @@ if(WITH_UNIXODBC) set (CMAKE_FLAGS "${CMAKE_FLAGS} -I${ODBC_INCLUDE_DIR}") exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS) + endif(NOT ODBC_CONFIG) else(WITH_UNIXODBC) find_program(ODBC_CONFIG iodbc-config $ENV{ODBC_PATH}/bin PATHS) if(NOT ODBC_CONFIG) - message(FATAL_ERROR "Couldn't find iODBC") - endif(NOT ODBC_CONFIG) + message(STATUS "Couldn't find iODBC") + else(NOT ODBC_CONFIG) message(STATUS "iODBC: Found iodbc-config in ${ODBC_CONFIG}") @@ -27,6 +28,7 @@ else(WITH_UNIXODBC) set(CMAKE_FLAGS "${CMAKE_FLAGS} ${ODBC_CFLAGS}") exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS) + endif(NOT ODBC_CONFIG) endif(WITH_UNIXODBC)