This is an automated email from the ASF dual-hosted git repository. mxmanghi pushed a commit to branch 3.1 in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
The following commit(s) were added to refs/heads/3.1 by this push: new 260b698 integrating latest CMakeList.txt improvements with automatic version determination and substitution 260b698 is described below commit 260b6986a6b4ab06b5d64b5d5d99a3cce0a67698 Author: Massimo Manghi <mxman...@apache.org> AuthorDate: Thu Dec 20 16:48:32 2018 +0100 integrating latest CMakeList.txt improvements with automatic version determination and substitution --- cmake/CMakeLists.txt | 63 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 16 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 054a4d6..3a43944 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -122,12 +122,12 @@ set(mod_rivet_sources # Add build targets... # =========================================================================== -add_library(mod_rivet ${mod_rivet_sources}) -add_library(rivetparser ${rivetparser_sources}) -add_library(rivetlib ${rivetlib_sources}) -add_library(rivet_worker_mpm ${rivet_worker_mpm_sources}) -add_library(rivet_prefork_mpm ${rivet_prefork_mpm_sources}) -add_library(rivet_lazy_mpm ${rivet_lazy_mpm_sources}) +add_library(mod_rivet SHARED ${mod_rivet_sources}) +add_library(rivetparser SHARED ${rivetparser_sources}) +add_library(rivetlib SHARED ${rivetlib_sources}) +add_library(rivet_worker_mpm SHARED ${rivet_worker_mpm_sources}) +add_library(rivet_prefork_mpm SHARED ${rivet_prefork_mpm_sources}) +add_library(rivet_lazy_mpm SHARED ${rivet_lazy_mpm_sources}) add_library(rivet::parser ALIAS rivetparser) add_library(rivet::lib ALIAS rivetparser) add_library(rivet::rivet ALIAS mod_rivet) @@ -135,12 +135,15 @@ add_library(rivet::worker_mpm ALIAS rivet_worker_mpm) add_library(rivet::prefork_mpm ALIAS rivet_prefork_mpm) add_library(rivet::lazy_mpm ALIAS rivet_lazy_mpm) -SET_TARGET_PROPERTIES(mod_rivet PROPERTIES PREFIX "" SUFFIX ".so") -SET_TARGET_PROPERTIES(rivet_worker_mpm PROPERTIES PREFIX "" SUFFIX ".so") -SET_TARGET_PROPERTIES(rivet_prefork_mpm PROPERTIES PREFIX "" SUFFIX ".so") -SET_TARGET_PROPERTIES(rivet_lazy_mpm PROPERTIES PREFIX "" SUFFIX ".so") -SET_TARGET_PROPERTIES(rivetparser PROPERTIES PREFIX "lib") -SET_TARGET_PROPERTIES(rivetlib PROPERTIES PREFIX "lib") +SET ( RIVET_LIB_SUFFIX ".so" ) +SET ( RIVET_LIB_PREFIX "lib" ) + +SET_TARGET_PROPERTIES(mod_rivet PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) +SET_TARGET_PROPERTIES(rivet_worker_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) +SET_TARGET_PROPERTIES(rivet_prefork_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) +SET_TARGET_PROPERTIES(rivet_lazy_mpm PROPERTIES PREFIX "" SUFFIX ${RIVET_LIB_SUFFIX}) +SET_TARGET_PROPERTIES(rivetparser PROPERTIES PREFIX ${RIVET_LIB_PREFIX}) +SET_TARGET_PROPERTIES(rivetlib PROPERTIES PREFIX ${RIVET_LIB_PREFIX}) # Definitions... # =========================================================================== @@ -185,6 +188,19 @@ MESSAGE ( STATUS " TCL_STUB_LIBRARY: " ${TCL_STUB_LIBRARY} ) # Locate Apache... # =========================================================================== MESSAGE ( STATUS "Searching for Apache..." ) + +if (NOT "${with-apache}" STREQUAL "") + MESSAGE ( STATUS " Apache directory manually set by -Dwith-apache=" ${with-apache} ) + get_filename_component(RIVET_APACHE_ROOT "${with-apache}" ABSOLUTE) + MESSAGE ( STATUS " Setting Apache root to: " ${RIVET_APACHE_ROOT} ) + + set ( APACHE_ROOT ${RIVET_APACHE_ROOT} ) + set ( APACHE_MODULE_DIR "${RIVET_APACHE_ROOT}/modules" ) + set ( APACHE_LIB_DIR "${RIVET_APACHE_ROOT}/lib" ) + set ( TclStub_ROOT ${RIVET_APACHE_ROOT}) + +endif () + find_package(APACHE REQUIRED) MESSAGE ( STATUS " APACHE_INCLUDE_DIR: " ${APACHE_INCLUDE_DIR} ) MESSAGE ( STATUS " APACHE_MODULE_DIR: " ${APACHE_MODULE_DIR} ) @@ -252,9 +268,9 @@ if(WIN32) #SET_TARGET_PROPERTIES(mod_rivet PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) target_link_libraries(mod_rivet ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} ) - target_link_libraries(rivet_worker_mpm ${APR_LIBRARY} ${APRUTIL_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) - target_link_libraries(rivet_prefork_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) - target_link_libraries(rivet_lazy_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet) + target_link_libraries(rivet_worker_mpm ${APR_LIBRARY} ${APRUTIL_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet ) + target_link_libraries(rivet_prefork_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet ) + target_link_libraries(rivet_lazy_mpm ${APR_LIBRARY} ${APACHE_HTTPD_LIBRARY} mod_rivet ) # rivet_worker_mpm.c uses round(), which is available in C99 SET_TARGET_PROPERTIES(rivet_worker_mpm PROPERTIES C_STANDARD 99) if(MSVC) @@ -305,7 +321,7 @@ set(UPLOAD_DIR ${with-upload-dir}) # Location of the Rivet library... # =========================================================================== if(NOT DEFINED RIVETLIB_DESTDIR) - set(RIVETLIB_DESTDIR "${APACHE_LIB_DIR}/rivet${RIVET_VERSION}") + set(RIVETLIB_DESTDIR "${APACHE_ROOT}/rivet${RIVET_VERSION}") endif(NOT DEFINED RIVETLIB_DESTDIR) if(TCL_THREADS) @@ -482,3 +498,18 @@ install(DIRECTORY ${RIVET_LIB_DIR}/packages/session ${RIVET_LIB_DIR}/packages/tclrivet DESTINATION ${RIVETLIB_DESTDIR}/packages) + +# Regenerate pkgIndex.tcl in all libraries... +# =========================================================================== +SET ( RIVET_LIBS_ARCH ${RIVETLIB_DESTDIR} ) +file(WRITE ${RIVETLIB_DESTDIR}/regenerate_pkgIndex.tcl +"puts \"Regenerating pkgIndex.tcl in [pwd]:\" +file delete {*}[glob [file join packages * pkgIndex.tcl]] pkgIndex.tcl +pkg_mkIndex -verbose [pwd] init.tcl packages/*/*.tcl *[info sharedlibextension]" +) +install(CODE " + execute_process(COMMAND ${TCL_TCLSH} regenerate_pkgIndex.tcl + WORKING_DIRECTORY ${RIVETLIB_DESTDIR}) + file(REMOVE ${RIVETLIB_DESTDIR}/regenerate_pkgIndex.tcl) + " +) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org For additional commands, e-mail: commits-h...@tcl.apache.org