]> git.openstreetmap.org Git - nominatim.git/blobdiff - CMakeLists.txt
move postcode table setup to sql/
[nominatim.git] / CMakeLists.txt
index dd73870502a947c62510fbeb57c992b9fd915539..f7d396d0ebc6be503d653085268e3e152cd2d08f 100644 (file)
@@ -57,20 +57,11 @@ endif()
 
 
 #-----------------------------------------------------------------------------
 
 
 #-----------------------------------------------------------------------------
-#  python and pyosmium (imports/updates only)
+#  python (imports/updates only)
 #-----------------------------------------------------------------------------
 
 if (BUILD_IMPORTER)
     find_package(PythonInterp 3.5 REQUIRED)
 #-----------------------------------------------------------------------------
 
 if (BUILD_IMPORTER)
     find_package(PythonInterp 3.5 REQUIRED)
-
-    find_program(PYOSMIUM pyosmium-get-changes)
-    if (NOT EXISTS "${PYOSMIUM}")
-        set(PYOSMIUM_PATH "")
-            message(WARNING "pyosmium-get-changes not found (required for updates)")
-    else()
-        set(PYOSMIUM_PATH "${PYOSMIUM}")
-        message(STATUS "Using pyosmium-get-changes at ${PYOSMIUM_PATH}")
-    endif()
 endif()
 
 #-----------------------------------------------------------------------------
 endif()
 
 #-----------------------------------------------------------------------------
@@ -86,8 +77,19 @@ if (BUILD_API OR BUILD_IMPORTER)
     # sanity check if PHP binary exists
     if (NOT EXISTS ${PHP_BIN})
         message(FATAL_ERROR "PHP binary not found. Install php or provide location with -DPHP_BIN=/path/php ")
     # sanity check if PHP binary exists
     if (NOT EXISTS ${PHP_BIN})
         message(FATAL_ERROR "PHP binary not found. Install php or provide location with -DPHP_BIN=/path/php ")
+    else()
+        message (STATUS "Using PHP binary " ${PHP_BIN})
+    endif()
+    if (NOT PHPCGI_BIN)
+        find_program (PHPCGI_BIN php-cgi)
+    endif()
+    # sanity check if PHP binary exists
+    if (NOT EXISTS ${PHPCGI_BIN})
+        message(WARNING "php-cgi binary not found. nominatim tool will not provide query functions.")
+        set (PHPCGI_BIN "")
+    else()
+        message (STATUS "Using php-cgi binary " ${PHPCGI_BIN})
     endif()
     endif()
-    message (STATUS "Using PHP binary " ${PHP_BIN})
 endif()
 
 #-----------------------------------------------------------------------------
 endif()
 
 #-----------------------------------------------------------------------------
@@ -115,22 +117,6 @@ if (BUILD_IMPORTER)
                   ${PROJECT_BINARY_DIR}/nominatim)
 endif()
 
                   ${PROJECT_BINARY_DIR}/nominatim)
 endif()
 
-#-----------------------------------------------------------------------------
-# Targets for running a development webserver from the build directory.
-#-----------------------------------------------------------------------------
-
-if (BUILD_API)
-   add_custom_target(serve
-           php -S 127.0.0.1:8088
-           WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website
-   )
-
-   add_custom_target(serve-global
-           php -S 0.0.0.0:8088
-           WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website
-   )
-endif()
-
 #-----------------------------------------------------------------------------
 # Tests
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # Tests
 #-----------------------------------------------------------------------------
@@ -142,7 +128,7 @@ if (BUILD_TESTS)
 
     find_program(PYTHON_BEHAVE behave)
     find_program(PYLINT NAMES pylint3 pylint)
 
     find_program(PYTHON_BEHAVE behave)
     find_program(PYLINT NAMES pylint3 pylint)
-    find_program(PYTEST pytest)
+    find_program(PYTEST NAMES pytest py.test-3 py.test)
     find_program(PHPCS phpcs)
     find_program(PHPUNIT phpunit)
 
     find_program(PHPCS phpcs)
     find_program(PHPUNIT phpunit)
 
@@ -180,7 +166,7 @@ if (BUILD_TESTS)
     if (PYLINT)
         message(STATUS "Using pylint binary ${PYLINT}")
         add_test(NAME pylint
     if (PYLINT)
         message(STATUS "Using pylint binary ${PYLINT}")
         add_test(NAME pylint
-                 COMMAND ${PYLINT} nominatim
+                 COMMAND ${PYLINT} --extension-pkg-whitelist=osmium nominatim
                  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
     else()
         message(WARNING "pylint not found. Python linting tests disabled.")
                  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
     else()
         message(WARNING "pylint not found. Python linting tests disabled.")