* 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

@@ -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
)