| [16cceaa] | 1 | ######################
|
|---|
| 2 | #
|
|---|
| 3 | # Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
|
|---|
| 4 | #
|
|---|
| 5 | # This library is free software; you can redistribute it and/or
|
|---|
| 6 | # modify it under the terms of the GNU Lesser General Public
|
|---|
| 7 | # License as published by the Free Software Foundation; either
|
|---|
| 8 | # version 2.1 of the License, or (at your option) any later version.
|
|---|
| 9 | #
|
|---|
| 10 | # This library is distributed in the hope that it will be useful,
|
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 13 | # Lesser General Public License for more details.
|
|---|
| 14 | #
|
|---|
| 15 | # You should have received a copy of the GNU Lesser General Public
|
|---|
| 16 | # License along with this library; if not, write to the Free Software
|
|---|
| 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|---|
| 18 | # MA 02110-1301 USA.
|
|---|
| 19 | #
|
|---|
| 20 | ######################
|
|---|
| 21 |
|
|---|
| [1c92d58] | 22 | SET(WEBSERVICE_OUTPUT_DIRECTORY "${WEB_OUTPUT_DIRECTORY}/webservice")
|
|---|
| [1e37648] | 23 | SET(WEBSERVICE_OUTPUT_APP_DIRECTORY "${WEBSERVICE_OUTPUT_DIRECTORY}/${WEBSERVICE_API_VERSION}")
|
|---|
| [1c92d58] | 24 | SET(WEBSERVICE_TEST_OUTPUT_DIRECTORY "${WEB_TEST_OUTPUT_DIRECTORY}/webservice")
|
|---|
| 25 |
|
|---|
| 26 | # switch Slim mode according to CMake debug mode
|
|---|
| 27 | SET(WEBSERVICE_MODE "production")
|
|---|
| 28 | IF(BUILD_DEBUG)
|
|---|
| 29 | SET(WEBSERVICE_MODE "development")
|
|---|
| 30 | ENDIF(BUILD_DEBUG)
|
|---|
| [16cceaa] | 31 |
|
|---|
| 32 | # ADD_CUSTOM_COMMAND(
|
|---|
| 33 | # OUTPUT
|
|---|
| 34 | # "${WEBCLIENT_OUTPUT_DIRECTORY}/${STAFF_WSDL_FILE}"
|
|---|
| 35 | # COMMAND ${CMAKE_COMMAND} -E copy_directory ${STAFF_WSDL_PATH} ${WEBSERVICE_OUTPUT_DIRECTORY}
|
|---|
| 36 | # WORKING_DIRECTORY "${STAFF_WSDL_PATH}"
|
|---|
| 37 | # )
|
|---|
| 38 |
|
|---|
| [1c92d58] | 39 | CONFIGURE_FILE("config/config.php.in" "${WEBSERVICE_OUTPUT_DIRECTORY}/config/config.php")
|
|---|
| [1e37648] | 40 | CONFIGURE_FILE("config/internalconfig.php.in" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}/inc/internalconfig.php")
|
|---|
| [1c92d58] | 41 | # workaround to copy "hidden" file .htaccess. copy command ignores it
|
|---|
| [1e37648] | 42 | CONFIGURE_FILE("htaccess.in" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}/.htaccess")
|
|---|
| [1c92d58] | 43 |
|
|---|
| [16cceaa] | 44 | FILE(GLOB src_HTDOCS "htdocs/*.*")
|
|---|
| [1c92d58] | 45 | ADD_CUSTOM_TARGET(webservice-prepare ALL
|
|---|
| [1e37648] | 46 | COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/htdocs" "${WEBSERVICE_OUTPUT_APP_DIRECTORY}"
|
|---|
| [16cceaa] | 47 | # DEPENDS "${WEBSERVICE_OUTPUT_DIRECTORY}/${STAFF_WSDL_FILE}"
|
|---|
| [1c92d58] | 48 | COMMENT "Preparing webservice"
|
|---|
| [16cceaa] | 49 | SOURCES ${src_HTDOCS}
|
|---|
| [1c92d58] | 50 | )
|
|---|
| 51 |
|
|---|
| 52 | #######################
|
|---|
| 53 | #
|
|---|
| 54 | # PHPUnit tests
|
|---|
| 55 | #
|
|---|
| 56 | #######################
|
|---|
| 57 | CONFIGURE_FILE("testconfig/testconfig.php.in" "${WEBSERVICE_TEST_OUTPUT_DIRECTORY}/testconfig/testconfig.php")
|
|---|
| 58 |
|
|---|
| 59 | FILE(GLOB src_HTDOCS_TEST "tests/*.*")
|
|---|
| 60 | ADD_CUSTOM_TARGET(webservice-tests-prepare ALL
|
|---|
| 61 | COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/tests" "${WEBSERVICE_TEST_OUTPUT_DIRECTORY}"
|
|---|
| 62 | # DEPENDS "${WEBSERVICE_OUTPUT_DIRECTORY}/${STAFF_WSDL_FILE}"
|
|---|
| 63 | COMMENT "Preparing webservice tests"
|
|---|
| 64 | SOURCES ${src_HTDOCS_TEST}
|
|---|
| [16cceaa] | 65 | )
|
|---|