* add POCO_STATIC definition in CMake

* Foundation must compile .mc file in CMake build
* Net must list all files in CMake build file
This commit is contained in:
Rangel Reale 2012-11-11 14:17:28 -02:00
parent c867a80520
commit 86b79a6dff
3 changed files with 131 additions and 2 deletions

View File

@ -67,6 +67,7 @@ option(POCO_UNBUNDLED
# Uncomment from next two lines to force statitc or dynamic library, default is autodetection
if(POCO_STATIC)
add_definitions( -DPOCO_STATIC -DPOCO_NO_AUTOMATIC_LIBS)
set( LIB_MODE STATIC )
message(STATUS "Building static libraries")
else(POCO_STATIC)

View File

@ -3,7 +3,27 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
set(LIBNAME "${LIBNAME}d")
endif()
if (WIN32)
# cmake has CMAKE_RC_COMPILER, but no message compiler
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# this path is only present for 2008+, but we currently require PATH to
# be set up anyway
get_filename_component(sdk_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH)
if (X64)
set(sdk_bindir "${sdk_dir}/bin/x64")
else (X64)
set(sdk_bindir "${sdk_dir}/bin")
endif (X64)
endif ()
find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}"
DOC "path to message compiler")
if (NOT CMAKE_MC_COMPILER)
message(FATAL_ERROR "message compiler not found: required to build")
endif (NOT CMAKE_MC_COMPILER)
message(STATUS "Found message compiler: ${CMAKE_MC_COMPILER}")
mark_as_advanced(CMAKE_MC_COMPILER)
endif(WIN32)
set( BASE_SRCS
src/ASCIIEncoding.cpp
src/Ascii.cpp
@ -184,6 +204,22 @@ set(WIN_SRCS
src/WindowsConsoleChannel.cpp
)
if (WIN32)
set(RES_SRCS ${CMAKE_SOURCE_DIR}/Foundation/include/Poco/pocomsg.h)
set_source_files_properties(${RES_SRCS} PROPERTIES GENERATED true)
add_custom_command(
OUTPUT ${RES_SRCS}
DEPENDS ${CMAKE_SOURCE_DIR}/Foundation/src/pocomsg.mc
COMMAND ${CMAKE_MC_COMPILER}
ARGS
-h ${CMAKE_SOURCE_DIR}/Foundation/src
-r ${CMAKE_SOURCE_DIR}/Foundation/src
${CMAKE_SOURCE_DIR}/Foundation/src/pocomsg.mc
VERBATIM # recommended: p260
)
list(APPEND WIN_SRCS ${RES_SRCS})
endif (WIN32)
set(LIN_SRCS
src/SyslogChannel.cpp
)

View File

@ -1,7 +1,99 @@
set(LIBNAME "PocoNet")
set(LIBNAME "${LIBNAME}${LIB_EXT}")
aux_source_directory(src BASE_SRCS)
set( BASE_SRCS
src/AbstractHTTPRequestHandler.cpp
src/DatagramSocket.cpp
src/DatagramSocketImpl.cpp
src/DialogSocket.cpp
src/DNS.cpp
src/FilePartSource.cpp
src/FTPClientSession.cpp
src/FTPStreamFactory.cpp
src/HostEntry.cpp
src/HTMLForm.cpp
src/HTTPAuthenticationParams.cpp
src/HTTPBasicCredentials.cpp
src/HTTPBufferAllocator.cpp
src/HTTPChunkedStream.cpp
src/HTTPClientSession.cpp
src/HTTPCookie.cpp
src/HTTPCredentials.cpp
src/HTTPDigestCredentials.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/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/PartHandler.cpp
src/PartSource.cpp
src/POP3ClientSession.cpp
src/QuotedPrintableDecoder.cpp
src/QuotedPrintableEncoder.cpp
src/RawSocket.cpp
src/RawSocketImpl.cpp
src/RemoteSyslogChannel.cpp
src/RemoteSyslogListener.cpp
src/Route.cpp
src/ServerSocket.cpp
src/ServerSocketImpl.cpp
src/SMTPChannel.cpp
src/SMTPClientSession.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
src/WebSocket.cpp
src/WebSocketImpl.cpp
)
set( WIN_SRCS
)