]> git.openstreetmap.org Git - nominatim.git/blobdiff - CMakeLists.txt
pylint may be available as pylint3 or pylint
[nominatim.git] / CMakeLists.txt
index d1dd69ba6ef6877edd9d44a83f9c92bac456e008..761531b10218ea5e7feda79c884de2841fc143bd 100644 (file)
@@ -61,7 +61,7 @@ endif()
 #-----------------------------------------------------------------------------
 
 if (BUILD_IMPORTER)
-    find_package(PythonInterp 3)
+    find_package(PythonInterp 3.5 REQUIRED)
 
     find_program(PYOSMIUM pyosmium-get-changes)
     if (NOT EXISTS "${PYOSMIUM}")
@@ -98,7 +98,6 @@ if (BUILD_IMPORTER)
    set(CUSTOMSCRIPTS
        check_import_finished.php
        country_languages.php
-       importWikipedia.php
        export.php
        query.php
        setup.php
@@ -111,29 +110,16 @@ if (BUILD_IMPORTER)
        configure_file(${PROJECT_SOURCE_DIR}/cmake/script.tmpl
                       ${PROJECT_BINARY_DIR}/utils/${script_source})
    endforeach()
+
+   configure_file(${PROJECT_SOURCE_DIR}/cmake/tool.tmpl
+                  ${PROJECT_BINARY_DIR}/nominatim)
 endif()
 
 #-----------------------------------------------------------------------------
-# webserver scripts (API only)
+# Targets for running a development webserver from the build directory.
 #-----------------------------------------------------------------------------
 
 if (BUILD_API)
-   set(WEBSITESCRIPTS
-       deletable.php
-       details.php
-       lookup.php
-       polygons.php
-       reverse.php
-       search.php
-       status.php
-   )
-
-   foreach (script_source ${WEBSITESCRIPTS})
-       configure_file(${PROJECT_SOURCE_DIR}/cmake/website.tmpl
-                      ${PROJECT_BINARY_DIR}/website/${script_source})
-   endforeach()
-
-
    add_custom_target(serve
            php -S 127.0.0.1:8088
            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website
@@ -154,6 +140,8 @@ if (BUILD_TESTS)
 
     set(TEST_BDD db osm2pgsql api)
 
+    find_program(PYLINT NAMES pylint3 pylint)
+
     foreach (test ${TEST_BDD})
         add_test(NAME bdd_${test}
                  COMMAND behave ${test}
@@ -169,6 +157,15 @@ if (BUILD_TESTS)
     add_test(NAME phpcs
              COMMAND phpcs --report-width=120 --colors lib website utils
              WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+
+    if (PYLINT)
+        message(STATUS "Using '${PYLINT}' for Python linting.")
+        add_test(NAME pylint
+                 COMMAND ${PYLINT} nominatim
+                 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+    else()
+        message(STATUS "pylint not found. Linting tests disabled.")
+    endif()
 endif()
 
 #-----------------------------------------------------------------------------