diff --git a/ApacheConnector/CMakeLists.txt b/ApacheConnector/CMakeLists.txt index 164760d16..36087fb27 100644 --- a/ApacheConnector/CMakeLists.txt +++ b/ApacheConnector/CMakeLists.txt @@ -1,20 +1,22 @@ set(LIBNAME "mod_poco") set(LIBNAMED "${LIBNAME}d") -include_directories( include /usr/include/apache2 /usr/include/apr-0 /usr/include/apr-1 ) +include_directories( include ${APACHE_INCLUDE_DIR} ${APRUTIL_INCLUDE_DIR} ) aux_source_directory(src SRCS) -add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) +add_library( ${LIBNAME} SHARED ${SRCS} ) 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} ) -add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) +add_library( ${LIBNAMED} SHARED ${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} ) + +add_subdirectory(samples) diff --git a/ApacheConnector/samples/CMakeLists.txt b/ApacheConnector/samples/CMakeLists.txt new file mode 100644 index 000000000..e584a1a2e --- /dev/null +++ b/ApacheConnector/samples/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory( FormServer ) +add_subdirectory( TimeServer ) diff --git a/ApacheConnector/samples/FormServer/CMakeLists.txt b/ApacheConnector/samples/FormServer/CMakeLists.txt new file mode 100644 index 000000000..ab0844dcd --- /dev/null +++ b/ApacheConnector/samples/FormServer/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "FormServer") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_library( ${SAMPLE_NAME} SHARED ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoNet PocoFoundation ) diff --git a/ApacheConnector/samples/TimeServer/CMakeLists.txt b/ApacheConnector/samples/TimeServer/CMakeLists.txt new file mode 100644 index 000000000..3248a228b --- /dev/null +++ b/ApacheConnector/samples/TimeServer/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "TimeServer-apache") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_library( ${SAMPLE_NAME} SHARED ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoNet PocoFoundation ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88f081256..32151c34a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ include(FindOpenSSL) include(contrib/cmake/FindMySQL.cmake) include(contrib/cmake/FindODBC.cmake) +include(contrib/cmake/FindAPR.cmake) +include(contrib/cmake/FindApache2.cmake) # OS Detection if(CMAKE_SYSTEM MATCHES "Windows") @@ -49,4 +51,7 @@ endif(OPENSSL_FOUND) add_subdirectory(Data) add_subdirectory(WebWidgets) add_subdirectory(Zip) -#add_subdirectory(ApacheConnector) + +if(APRUTIL_FOUND AND APACHE_FOUND) + add_subdirectory(ApacheConnector) +endif(APRUTIL_FOUND AND APACHE_FOUND) diff --git a/NetSSL_OpenSSL/CMakeLists.txt b/NetSSL_OpenSSL/CMakeLists.txt index 85dcdc294..c4d98cde6 100644 --- a/NetSSL_OpenSSL/CMakeLists.txt +++ b/NetSSL_OpenSSL/CMakeLists.txt @@ -26,3 +26,5 @@ install( TARGETS ${LIBNAME} ${LIBNAMED} DESTINATION lib ) + +add_subdirectory( samples ) \ No newline at end of file diff --git a/NetSSL_OpenSSL/samples/CMakeLists.txt b/NetSSL_OpenSSL/samples/CMakeLists.txt new file mode 100644 index 000000000..18a675f6b --- /dev/null +++ b/NetSSL_OpenSSL/samples/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory( HTTPSTimeServer ) +add_subdirectory( download ) diff --git a/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt b/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt new file mode 100644 index 000000000..e250e07a9 --- /dev/null +++ b/NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "HTTPSTimeServer") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoUtil PocoNet PocoXML PocoFoundation ) diff --git a/NetSSL_OpenSSL/samples/download/CMakeLists.txt b/NetSSL_OpenSSL/samples/download/CMakeLists.txt new file mode 100644 index 000000000..f818c749b --- /dev/null +++ b/NetSSL_OpenSSL/samples/download/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "download-ssl") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoNetSSL PocoUtil PocoNet PocoXML PocoFoundation ) diff --git a/WebWidgets/ExtJS/CMakeLists.txt b/WebWidgets/ExtJS/CMakeLists.txt index e9d7c842e..e720632cc 100644 --- a/WebWidgets/ExtJS/CMakeLists.txt +++ b/WebWidgets/ExtJS/CMakeLists.txt @@ -32,4 +32,5 @@ install( DESTINATION lib ) +add_subdirectory( samples ) #add_subdirectory( testsuite ) diff --git a/WebWidgets/ExtJS/samples/CMakeLists.txt b/WebWidgets/ExtJS/samples/CMakeLists.txt new file mode 100644 index 000000000..b50ae512c --- /dev/null +++ b/WebWidgets/ExtJS/samples/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory( Picross ) +add_subdirectory( Server ) diff --git a/WebWidgets/ExtJS/samples/Picross/CMakeLists.txt b/WebWidgets/ExtJS/samples/Picross/CMakeLists.txt new file mode 100644 index 000000000..eb200e1eb --- /dev/null +++ b/WebWidgets/ExtJS/samples/Picross/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "Picross") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoExtJS PocoWebWidgets PocoUtil PocoNet PocoXML PocoFoundation ) diff --git a/WebWidgets/ExtJS/samples/Server/CMakeLists.txt b/WebWidgets/ExtJS/samples/Server/CMakeLists.txt new file mode 100644 index 000000000..b5431c147 --- /dev/null +++ b/WebWidgets/ExtJS/samples/Server/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "Server") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoExtJS PocoWebWidgets PocoUtil PocoNet PocoXML PocoFoundation ) diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt index dee850337..901ff2634 100644 --- a/XML/CMakeLists.txt +++ b/XML/CMakeLists.txt @@ -29,4 +29,5 @@ install( DESTINATION lib ) +add_subdirectory( samples ) #add_subdirectory( testsuite ) diff --git a/XML/samples/CMakeLists.txt b/XML/samples/CMakeLists.txt new file mode 100644 index 000000000..659591ff6 --- /dev/null +++ b/XML/samples/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(DOMParser) +add_subdirectory(DOMWriter) +add_subdirectory(PrettyPrint) +add_subdirectory(SAXParser) + diff --git a/XML/samples/DOMParser/CMakeLists.txt b/XML/samples/DOMParser/CMakeLists.txt new file mode 100644 index 000000000..7cbb451c4 --- /dev/null +++ b/XML/samples/DOMParser/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "DOMParser") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) diff --git a/XML/samples/DOMWriter/CMakeLists.txt b/XML/samples/DOMWriter/CMakeLists.txt new file mode 100644 index 000000000..04447fff2 --- /dev/null +++ b/XML/samples/DOMWriter/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "DOMWriter") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) diff --git a/XML/samples/PrettyPrint/CMakeLists.txt b/XML/samples/PrettyPrint/CMakeLists.txt new file mode 100644 index 000000000..64b5e6122 --- /dev/null +++ b/XML/samples/PrettyPrint/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "PrettyPrint") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) diff --git a/XML/samples/SAXParser/CMakeLists.txt b/XML/samples/SAXParser/CMakeLists.txt new file mode 100644 index 000000000..a7bbac65b --- /dev/null +++ b/XML/samples/SAXParser/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "SAXParser") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoXML PocoFoundation ) diff --git a/Zip/CMakeLists.txt b/Zip/CMakeLists.txt index 249fac6a3..d29e8b62b 100644 --- a/Zip/CMakeLists.txt +++ b/Zip/CMakeLists.txt @@ -26,3 +26,5 @@ install( TARGETS ${LIBNAME} ${LIBNAMED} DESTINATION lib ) + +add_subdirectory(samples) diff --git a/Zip/samples/CMakeLists.txt b/Zip/samples/CMakeLists.txt new file mode 100644 index 000000000..459b10b0c --- /dev/null +++ b/Zip/samples/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory( zip ) +add_subdirectory( unzip ) diff --git a/Zip/samples/unzip/CMakeLists.txt b/Zip/samples/unzip/CMakeLists.txt new file mode 100644 index 000000000..bbeb31a15 --- /dev/null +++ b/Zip/samples/unzip/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "unzip") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation ) diff --git a/Zip/samples/zip/CMakeLists.txt b/Zip/samples/zip/CMakeLists.txt new file mode 100644 index 000000000..b52c66684 --- /dev/null +++ b/Zip/samples/zip/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SAMPLE_NAME "zip") + +set(LOCAL_SRCS "") +aux_source_directory(src LOCAL_SRCS) + +add_executable( ${SAMPLE_NAME} ${LOCAL_SRCS} ) +set_target_properties( ${SAMPLE_NAME} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} ) +target_link_libraries( ${SAMPLE_NAME} PocoZip PocoUtil PocoXML PocoFoundation ) diff --git a/contrib/cmake/FindAPR.cmake b/contrib/cmake/FindAPR.cmake new file mode 100644 index 000000000..3a7a11ca3 --- /dev/null +++ b/contrib/cmake/FindAPR.cmake @@ -0,0 +1,94 @@ +# -*- cmake -*- + +# - Find Apache Portable Runtime +# Find the APR includes and libraries +# This module defines +# APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc. +# APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR. +# APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR. +# also defined, but not for general use are +# APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library. + +# APR first. + +FIND_PATH(APR_INCLUDE_DIR apr.h +/usr/local/include/apr-1 +/usr/local/include/apr-1.0 +/usr/include/apr-1 +/usr/include/apr-1.0 +) + +SET(APR_NAMES ${APR_NAMES} apr-1) +FIND_LIBRARY(APR_LIBRARY + NAMES ${APR_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (APR_LIBRARY AND APR_INCLUDE_DIR) + SET(APR_LIBRARIES ${APR_LIBRARY}) + SET(APR_FOUND "YES") +ELSE (APR_LIBRARY AND APR_INCLUDE_DIR) + SET(APR_FOUND "NO") +ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR) + + +IF (APR_FOUND) + IF (NOT APR_FIND_QUIETLY) + MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}") + ENDIF (NOT APR_FIND_QUIETLY) +ELSE (APR_FOUND) + IF (APR_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find APR library") + ENDIF (APR_FIND_REQUIRED) +ENDIF (APR_FOUND) + +# Deprecated declarations. +SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH) + +MARK_AS_ADVANCED( + APR_LIBRARY + APR_INCLUDE_DIR + ) + +# Next, APRUTIL. + +FIND_PATH(APRUTIL_INCLUDE_DIR apu.h +/usr/local/include/apr-1 +/usr/local/include/apr-1.0 +/usr/include/apr-1 +/usr/include/apr-1.0 +) + +SET(APRUTIL_NAMES ${APRUTIL_NAMES} aprutil-1) +FIND_LIBRARY(APRUTIL_LIBRARY + NAMES ${APRUTIL_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY}) + SET(APRUTIL_FOUND "YES") +ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + SET(APRUTIL_FOUND "NO") +ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) + + +IF (APRUTIL_FOUND) + IF (NOT APRUTIL_FIND_QUIETLY) + MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}") + ENDIF (NOT APRUTIL_FIND_QUIETLY) +ELSE (APRUTIL_FOUND) + IF (APRUTIL_FIND_REQUIRED) + MESSAGE(STATUS "Could not find APRUTIL library") + ENDIF (APRUTIL_FIND_REQUIRED) +ENDIF (APRUTIL_FOUND) + +# Deprecated declarations. +SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} ) +GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH) + +MARK_AS_ADVANCED( + APRUTIL_LIBRARY + APRUTIL_INCLUDE_DIR + ) diff --git a/contrib/cmake/FindApache2.cmake b/contrib/cmake/FindApache2.cmake new file mode 100644 index 000000000..ea1dd0229 --- /dev/null +++ b/contrib/cmake/FindApache2.cmake @@ -0,0 +1,31 @@ +# -*- cmake -*- + +# - Find Apache Runtime +# Find the APACHE includes and libraries +# This module defines +# APACHE_INCLUDE_DIR and APACHEUTIL_INCLUDE_DIR, where to find APACHE.h, etc. +# APACHE_LIBRARIES and APACHEUTIL_LIBRARIES, the libraries needed to use APACHE. +# APACHE_FOUND and APACHEUTIL_FOUND, If false, do not try to use APACHE. +# also defined, but not for general use are +# APACHE_LIBRARY and APACHEUTIL_LIBRARY, where to find the APACHE library. + +FIND_PATH(APACHE_INCLUDE_DIR httpd.h +/usr/local/include/apache2 +/usr/include/apache2 +) + +IF (APACHE_INCLUDE_DIR) + SET(APACHE_FOUND "YES") +ELSE (APACHE_LIBRARY AND APACHE_INCLUDE_DIR) + SET(APACHE_FOUND "NO") +ENDIF (APACHE_INCLUDE_DIR) + + +IF (APACHE_FOUND) + MESSAGE(STATUS "Found APACHE: ${APACHE_INCLUDE_DIR}") +ENDIF (APACHE_FOUND) + +MARK_AS_ADVANCED( + APACHE_INCLUDE_DIR + ) +