mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-29 12:45:22 +01:00
rest of cmake scripts for samples + apache/apr detection
This commit is contained in:
parent
24e706aa2a
commit
60e1433f51
@ -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)
|
||||
|
2
ApacheConnector/samples/CMakeLists.txt
Normal file
2
ApacheConnector/samples/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_subdirectory( FormServer )
|
||||
add_subdirectory( TimeServer )
|
8
ApacheConnector/samples/FormServer/CMakeLists.txt
Normal file
8
ApacheConnector/samples/FormServer/CMakeLists.txt
Normal file
@ -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 )
|
8
ApacheConnector/samples/TimeServer/CMakeLists.txt
Normal file
8
ApacheConnector/samples/TimeServer/CMakeLists.txt
Normal file
@ -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 )
|
@ -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)
|
||||
|
@ -26,3 +26,5 @@ install(
|
||||
TARGETS ${LIBNAME} ${LIBNAMED}
|
||||
DESTINATION lib
|
||||
)
|
||||
|
||||
add_subdirectory( samples )
|
2
NetSSL_OpenSSL/samples/CMakeLists.txt
Normal file
2
NetSSL_OpenSSL/samples/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_subdirectory( HTTPSTimeServer )
|
||||
add_subdirectory( download )
|
8
NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt
Normal file
8
NetSSL_OpenSSL/samples/HTTPSTimeServer/CMakeLists.txt
Normal file
@ -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 )
|
8
NetSSL_OpenSSL/samples/download/CMakeLists.txt
Normal file
8
NetSSL_OpenSSL/samples/download/CMakeLists.txt
Normal file
@ -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 )
|
@ -32,4 +32,5 @@ install(
|
||||
DESTINATION lib
|
||||
)
|
||||
|
||||
add_subdirectory( samples )
|
||||
#add_subdirectory( testsuite )
|
||||
|
2
WebWidgets/ExtJS/samples/CMakeLists.txt
Normal file
2
WebWidgets/ExtJS/samples/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_subdirectory( Picross )
|
||||
add_subdirectory( Server )
|
8
WebWidgets/ExtJS/samples/Picross/CMakeLists.txt
Normal file
8
WebWidgets/ExtJS/samples/Picross/CMakeLists.txt
Normal file
@ -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 )
|
8
WebWidgets/ExtJS/samples/Server/CMakeLists.txt
Normal file
8
WebWidgets/ExtJS/samples/Server/CMakeLists.txt
Normal file
@ -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 )
|
@ -29,4 +29,5 @@ install(
|
||||
DESTINATION lib
|
||||
)
|
||||
|
||||
add_subdirectory( samples )
|
||||
#add_subdirectory( testsuite )
|
||||
|
5
XML/samples/CMakeLists.txt
Normal file
5
XML/samples/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
add_subdirectory(DOMParser)
|
||||
add_subdirectory(DOMWriter)
|
||||
add_subdirectory(PrettyPrint)
|
||||
add_subdirectory(SAXParser)
|
||||
|
8
XML/samples/DOMParser/CMakeLists.txt
Normal file
8
XML/samples/DOMParser/CMakeLists.txt
Normal file
@ -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 )
|
8
XML/samples/DOMWriter/CMakeLists.txt
Normal file
8
XML/samples/DOMWriter/CMakeLists.txt
Normal file
@ -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 )
|
8
XML/samples/PrettyPrint/CMakeLists.txt
Normal file
8
XML/samples/PrettyPrint/CMakeLists.txt
Normal file
@ -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 )
|
8
XML/samples/SAXParser/CMakeLists.txt
Normal file
8
XML/samples/SAXParser/CMakeLists.txt
Normal file
@ -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 )
|
@ -26,3 +26,5 @@ install(
|
||||
TARGETS ${LIBNAME} ${LIBNAMED}
|
||||
DESTINATION lib
|
||||
)
|
||||
|
||||
add_subdirectory(samples)
|
||||
|
2
Zip/samples/CMakeLists.txt
Normal file
2
Zip/samples/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_subdirectory( zip )
|
||||
add_subdirectory( unzip )
|
8
Zip/samples/unzip/CMakeLists.txt
Normal file
8
Zip/samples/unzip/CMakeLists.txt
Normal file
@ -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 )
|
8
Zip/samples/zip/CMakeLists.txt
Normal file
8
Zip/samples/zip/CMakeLists.txt
Normal file
@ -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 )
|
94
contrib/cmake/FindAPR.cmake
Normal file
94
contrib/cmake/FindAPR.cmake
Normal file
@ -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
|
||||
)
|
31
contrib/cmake/FindApache2.cmake
Normal file
31
contrib/cmake/FindApache2.cmake
Normal file
@ -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
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user