rest of cmake scripts for samples + apache/apr detection

This commit is contained in:
Marian Krivos 2009-02-21 09:58:44 +00:00
parent 24e706aa2a
commit 60e1433f51
25 changed files with 251 additions and 4 deletions

View File

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

View File

@ -0,0 +1,2 @@
add_subdirectory( FormServer )
add_subdirectory( TimeServer )

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

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

View File

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

View File

@ -26,3 +26,5 @@ install(
TARGETS ${LIBNAME} ${LIBNAMED}
DESTINATION lib
)
add_subdirectory( samples )

View File

@ -0,0 +1,2 @@
add_subdirectory( HTTPSTimeServer )
add_subdirectory( download )

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

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

View File

@ -32,4 +32,5 @@ install(
DESTINATION lib
)
add_subdirectory( samples )
#add_subdirectory( testsuite )

View File

@ -0,0 +1,2 @@
add_subdirectory( Picross )
add_subdirectory( Server )

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

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

View File

@ -29,4 +29,5 @@ install(
DESTINATION lib
)
add_subdirectory( samples )
#add_subdirectory( testsuite )

View File

@ -0,0 +1,5 @@
add_subdirectory(DOMParser)
add_subdirectory(DOMWriter)
add_subdirectory(PrettyPrint)
add_subdirectory(SAXParser)

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

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

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

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

View File

@ -26,3 +26,5 @@ install(
TARGETS ${LIBNAME} ${LIBNAMED}
DESTINATION lib
)
add_subdirectory(samples)

View File

@ -0,0 +1,2 @@
add_subdirectory( zip )
add_subdirectory( unzip )

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

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

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

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