Ver código fonte

Merge pull request #650 from siemens/cmake

Add CMake support to more packages
Günter Obiltschnig 11 anos atrás
pai
commit
60e8a19062

+ 1 - 0
.gitignore

@@ -29,6 +29,7 @@ CMakeFiles
 CMakeCache.txt
 CPackConfig.cmake
 CPackSourceConfig.cmake
+cmake_*
 
 # Packages #
 ############

+ 24 - 0
CMakeLists.txt

@@ -84,6 +84,10 @@ option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
 option(ENABLE_SEVENZIP "Enable SevenZip" ON)
 option(ENABLE_ZIP "Enable Zip" ON)
 option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" ON)
+option(ENABLE_CPPPARSER "Enable C++ parser" ON)
+option(ENABLE_POCODOC "Enable Poco Documentation Generator" ON)
+option(ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
+option(ENABLE_PAGECOMPILER_FILE2PAGE "Enable File2Page" ON)
 
 option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF)
 
@@ -249,6 +253,26 @@ if(APRUTIL_FOUND AND APACHE_FOUND)
     endif()
 endif(APRUTIL_FOUND AND APACHE_FOUND)
 
+if(ENABLE_CPPPARSER)
+add_subdirectory(CppParser)
+list(APPEND Poco_COMPONENTS "CppParser")
+endif()
+
+if(ENABLE_POCODOC)
+add_subdirectory(PocoDoc)
+list(APPEND Poco_COMPONENTS "PocoDoc")
+endif()
+
+if(ENABLE_PAGECOMPILER)
+add_subdirectory(PageCompiler)
+list(APPEND Poco_COMPONENTS "PageCompiler")
+endif()
+
+if(ENABLE_PAGECOMPILER_FILE2PAGE)
+add_subdirectory(PageCompiler/File2Page)
+list(APPEND Poco_COMPONENTS "File2Page")
+endif()
+
 #############################################################
 # Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
 configure_file(

+ 49 - 0
CppParser/CMakeLists.txt

@@ -0,0 +1,49 @@
+set(LIBNAME "CppParser")
+set(POCO_LIBNAME "Poco${LIBNAME}")
+
+# Sources
+file(GLOB SRCS_G "src/*.cpp")
+POCO_SOURCES_AUTO( SRCS ${SRCS_G})
+
+# Headers
+file(GLOB_RECURSE HDRS_G "include/*.h" )
+POCO_HEADERS_AUTO( SRCS ${HDRS_G})
+
+add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} )
+add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")
+set_target_properties( "${LIBNAME}"
+    PROPERTIES
+    VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
+    OUTPUT_NAME ${POCO_LIBNAME}
+    DEFINE_SYMBOL CppParser_EXPORTS
+    )
+
+target_link_libraries( "${LIBNAME}" Foundation)
+target_include_directories( "${LIBNAME}"
+    PUBLIC
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+        $<INSTALL_INTERFACE:include>
+    PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
+    )
+
+install(
+    DIRECTORY include/Poco
+    DESTINATION include
+    COMPONENT Devel
+    PATTERN ".svn" EXCLUDE
+    )
+
+install(
+    TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION bin
+    INCLUDES DESTINATION include
+    )
+
+POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
+
+if (ENABLE_TESTS)
+  add_subdirectory(testsuite)
+endif ()
+

+ 4 - 0
CppParser/cmake/PocoCppParserConfig.cmake

@@ -0,0 +1,4 @@
+include(CMakeFindDependencyMacro)
+set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR})
+find_dependency(PocoFoundation)
+include("${CMAKE_CURRENT_LIST_DIR}/PocoCppParserTargets.cmake")

+ 17 - 0
CppParser/testsuite/CMakeLists.txt

@@ -0,0 +1,17 @@
+set(TESTUNIT "${LIBNAME}-testrunner")
+
+# Sources
+file(GLOB SRCS_G "src/*.cpp")
+POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
+
+# Headers
+file(GLOB_RECURSE HDRS_G "src/*.h" )
+POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
+
+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}  PocoCppParser PocoFoundation CppUnit )

+ 0 - 4
CppUnit/CMakeLists.txt

@@ -20,7 +20,3 @@ target_include_directories( "${LIBNAME}"
         $<INSTALL_INTERFACE:include>
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
     )
-
-if(WIN32)
-    add_subdirectory(WinTestRunner)
-endif(WIN32)

+ 3 - 8
Crypto/testsuite/CMakeLists.txt

@@ -8,7 +8,7 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
@@ -19,11 +19,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoCrypto PocoNetSSL PocoXML PocoUtil PocoFoundation CppUnit )
-if( WIN32)
-    #TODO: Is this flag always required?
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-else()
+if(UNIX)
     target_link_libraries( ${TESTUNIT} pthread)
-endif(WIN32)
-
+endif(UNIX)

+ 1 - 2
Data/MySQL/testsuite/CMakeLists.txt

@@ -8,11 +8,10 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+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} PocoDataMySQL PocoData PocoFoundation CppUnit )
-

+ 1 - 6
Data/ODBC/testsuite/CMakeLists.txt

@@ -8,15 +8,10 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+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} PocoDataODBC PocoData PocoFoundation CppUnit )
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
-

+ 5 - 7
Data/SQLite/testsuite/CMakeLists.txt

@@ -8,16 +8,14 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
+    src/WinCEDriver.cpp
+)
+
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoDataSQLite PocoData PocoFoundation CppUnit )
-if( WIN32)
-    #TODO: Is this flag always required?
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
-

+ 5 - 6
Data/testsuite/CMakeLists.txt

@@ -8,10 +8,14 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
+    src/WinCEDriver.cpp
+)
+
 #TODO: Why is this file there? It doesn't compile if it is include in the sources
 POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/StatementImpl.cpp
@@ -20,8 +24,3 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoData PocoUtil PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    #TODO: Is this flag always required?
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)

+ 0 - 5
Foundation/CMakeLists.txt

@@ -29,11 +29,6 @@ POCO_SOURCES_AUTO_PLAT( SRCS WIN32
     )
 endif()
 
-POCO_HEADERS_AUTO( SRCS
-    include/Poco/WindowsConsoleChannel.h
-    include/Poco/EventLogChannel.h
-    )
-
 # Messages
 POCO_MESSAGES( SRCS Logging src/pocomsg.mc)
 

+ 11 - 9
Foundation/testsuite/CMakeLists.txt

@@ -15,36 +15,38 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+# WinDriver depends on WinTestRunner which depends on MFC, and we don't want that
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
-POCO_SOURCES_PLAT( TEST_SRCS FoundationTest WINCE
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
     src/WinCEDriver.cpp
 )
 
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
 set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
-#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
+
 target_link_libraries( ${TESTUNIT} PocoFoundation CppUnit )
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-else()
+if(UNIX)
     target_link_libraries( ${TESTUNIT} pthread)
-endif(WIN32)
+endif(UNIX)
 
 # The test is run in the runtime directory. So the test data is copied there too
 add_custom_command(TARGET ${TESTUNIT} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data )
 
 # TestApp
+if(WINCE)
+add_executable( TestApp src/TestApp_WINCE.cpp )
+set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+else()
 add_executable( TestApp src/TestApp.cpp )
+endif()
 # The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests
 set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
 target_link_libraries( TestApp PocoFoundation )
-# TODO: Add TestApp_WINCE
 
 if(NOT POCO_STATIC)
 # TestLibrary

+ 5 - 6
JSON/testsuite/CMakeLists.txt

@@ -8,19 +8,18 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
+    src/WinCEDriver.cpp
+)
+
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT}  PocoJSON PocoFoundation CppUnit )
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
 
 # The test is run in the build directory. So the test data is copied there too
 add_custom_command(TARGET ${TESTUNIT} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data )
-

+ 5 - 6
MongoDB/testsuite/CMakeLists.txt

@@ -8,17 +8,16 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
+    src/WinCEDriver.cpp
+)
+
 set(TESTUNIT "${LIBNAME}-testrunner")
 
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT}  PocoMongoDB PocoFoundation CppUnit )
-if( WIN32)
-    #TODO: Is this flag always required?
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)

+ 3 - 0
Net/samples/WebSocketServer/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoNet PocoUtil PocoJSON PocoXML PocoFoundation )

+ 5 - 5
Net/testsuite/CMakeLists.txt

@@ -8,14 +8,14 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
+    src/WinCEDriver.cpp
+)
+
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)

+ 1 - 6
NetSSL_OpenSSL/testsuite/CMakeLists.txt

@@ -8,7 +8,7 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
@@ -19,10 +19,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
 
 # The test is run in the build directory. So the test data is copied there too
 add_custom_command(TARGET ${TESTUNIT} POST_BUILD
@@ -30,4 +26,3 @@ add_custom_command(TARGET ${TESTUNIT} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
                    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml
                    )
-

+ 1 - 6
NetSSL_Win/testsuite/CMakeLists.txt

@@ -8,7 +8,7 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
@@ -19,10 +19,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
 
 # The test is run in the build directory. So the test data is copied there too
 add_custom_command(TARGET ${TESTUNIT} POST_BUILD
@@ -30,4 +26,3 @@ add_custom_command(TARGET ${TESTUNIT} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
                    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTUNIT}.xml
                    )
-

+ 1 - 6
PDF/testsuite/CMakeLists.txt

@@ -8,15 +8,10 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+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}  PocoPDF PocoFoundation CppUnit )
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
-

+ 23 - 0
PageCompiler/CMakeLists.txt

@@ -0,0 +1,23 @@
+set(POCO_EXENAME "PageCompiler")
+
+# Sources
+file(GLOB SRCS_G "src/*.cpp")
+POCO_SOURCES_AUTO( SRCS ${SRCS_G})
+
+add_executable( "${POCO_EXENAME}" ${SRCS} )
+set_target_properties( "${POCO_EXENAME}"
+    PROPERTIES
+    OUTPUT_NAME cpspc
+    )
+
+target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
+
+install(
+    TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION bin
+    INCLUDES DESTINATION include
+    )
+
+#POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")

+ 23 - 0
PageCompiler/File2Page/CMakeLists.txt

@@ -0,0 +1,23 @@
+set(POCO_EXENAME "File2Page")
+
+# Sources
+file(GLOB SRCS_G "src/*.cpp")
+POCO_SOURCES_AUTO( SRCS ${SRCS_G})
+
+add_executable( "${POCO_EXENAME}" ${SRCS} )
+set_target_properties( "${POCO_EXENAME}"
+    PROPERTIES
+    OUTPUT_NAME f2cpsp
+    )
+
+target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
+
+install(
+    TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION bin
+    INCLUDES DESTINATION include
+    )
+
+#POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")

+ 19 - 0
PocoDoc/CMakeLists.txt

@@ -0,0 +1,19 @@
+set(POCO_EXENAME "PocoDoc")
+
+# Sources
+file(GLOB SRCS_G "src/*.cpp")
+POCO_SOURCES_AUTO( SRCS ${SRCS_G})
+
+add_executable( "${POCO_EXENAME}" ${SRCS} )
+
+target_link_libraries( "${POCO_EXENAME}" Util XML Foundation CppParser)
+
+install(
+    TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"
+    LIBRARY DESTINATION lib${LIB_SUFFIX}
+    ARCHIVE DESTINATION lib${LIB_SUFFIX}
+    RUNTIME DESTINATION bin
+    INCLUDES DESTINATION include
+    )
+
+#POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")

+ 3 - 0
Util/samples/SampleApp/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation )

+ 3 - 0
Util/samples/SampleServer/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation )

+ 3 - 0
Util/samples/pkill/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoUtil PocoJSON PocoXML PocoFoundation )

+ 4 - 5
Util/testsuite/CMakeLists.txt

@@ -9,12 +9,15 @@ file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
 POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
-    src/WinDriver.cpp
     src/WinConfigurationTest.cpp
     src/WinRegistryTest.cpp
     src/WindowsTestSuite.cpp
 )
 
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
+    src/WinDriver.cpp
+)
+
 POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
     src/WinCEDriver.cpp
 )
@@ -22,7 +25,3 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoUtil PocoJSON PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)

+ 1 - 6
XML/testsuite/CMakeLists.txt

@@ -8,7 +8,7 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
@@ -19,8 +19,3 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
 add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 target_link_libraries( ${TESTUNIT} PocoXML PocoFoundation CppUnit)
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
-

+ 3 - 0
Zip/samples/unzip/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation )

+ 3 - 0
Zip/samples/zip/CMakeLists.txt

@@ -4,4 +4,7 @@ set(LOCAL_SRCS "")
 aux_source_directory(src LOCAL_SRCS)
 
 add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} )
+if(WINCE)
+set_target_properties( ${SAMPLE_NAME} PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
+endif()
 target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation )

+ 1 - 6
Zip/testsuite/CMakeLists.txt

@@ -8,7 +8,7 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
 file(GLOB_RECURSE HDRS_G "src/*.h" )
 POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
 
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
     src/WinDriver.cpp
 )
 
@@ -20,12 +20,7 @@ add_executable( ${TESTUNIT} ${TEST_SRCS} )
 add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
 #set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
 target_link_libraries( ${TESTUNIT}  PocoZip PocoNet PocoFoundation CppUnit )
-if( WIN32)
-    add_definitions("-D_AFXDLL")
-    target_link_libraries( ${TESTUNIT} WinTestRunner)
-endif(WIN32)
 
 # The test is run in the build directory. So the test data is copied there too
 add_custom_command(TARGET ${TESTUNIT} POST_BUILD
                    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data )
-

+ 27 - 0
doc/00200-GettingStarted.page

@@ -288,6 +288,33 @@ available:
     $ ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL
 ----
 
+!!Building using CMake
+
+As an alternative to the platform specific Makefiles and Solutions, CMake can be used
+to do build Poco. CMake is a cross platform Makefile generator that also supports 
+Microsoft Visual Studio and Apple XCode.
+Poco requires CMake 3.0 or higher. Static binaries for many platforms can be downloaded from http://www.cmake.org/
+
+CMake supports out of source builds and this is the recommended way to build Poco using CMake.
+
+Assuming you are currently in the Poco source directory on a Unix machine
+and you like to build Poco with the generated Makefiles just type the following commands.
+
+    $ mkdir cmake_build
+    $ cd cmake_build
+    $ cmake ..
+    $ make
+
+This will build Poco in a subdirectory cmake_build. All files produced during build are located in this directory.
+
+CMake allows you to set some build time options. As an example: to disable the SevenZip support
+type the following command:
+
+    $ cmake -DENABLE_SEVENZIP=OFF ..
+
+Similar options are available for other components (see: CMakeLists.txt).
+----
+
 
 !!!Tutorials And Sample Code