This repository has been archived by the owner on Jan 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
63 lines (51 loc) · 1.67 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 2.8)
project(geoapp NONE)
include(CTest)
enable_testing()
find_package(PythonInterp 2.7 REQUIRED)
set(BUILD_TESTING ON CACHE BOOL "Enable geoapp testing")
# set up targets for node programs
set(NODE_MODULES_PATH "${CMAKE_CURRENT_SOURCE_DIR}/node_modules")
set(JSHINT_EXECUTABLE "${NODE_MODULES_PATH}/.bin/jshint")
set(JSCS_EXECUTABLE "${NODE_MODULES_PATH}/.bin/jscs")
set(GRUNT_EXECUTABLE "${NODE_MODULES_PATH}/.bin/grunt")
set(flake8_config "${PROJECT_SOURCE_DIR}/tests/flake8.cfg")
set(JS_HINT_TESTS ON CACHE BOOL "Generate jshint style tests for JS source files.")
set(JSCS_TESTS ON CACHE BOOL "Generate jscs style tests for JS source files.")
set(PYTHON_STATIC_ANALYSIS ON CACHE BOOL "Generate style tests for python source files.")
if(PYTHON_STATIC_ANALYSIS)
find_program(FLAKE8_EXECUTABLE flake8)
endif()
find_package(PythonInterp REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(${JS_HINT_TESTS})
add_custom_target(
jshint-binary
ALL
DEPENDS "${JSHINT_EXECUTABLE}"
)
add_test(
NAME "jshint"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${JSHINT_EXECUTABLE}" "client/js"
)
endif() # JS_HINT_TESTS
if(${JSCS_TESTS})
add_custom_target(
jscs-binary
ALL
DEPENDS "${JSCS_EXECUTABLE}"
)
add_test(
NAME "jscs"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${JSCS_EXECUTABLE}" "client/js"
)
endif() # JSCS_TESTS
if(${PYTHON_STATIC_ANALYSIS})
add_test(
NAME "python_static_analysis"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${FLAKE8_EXECUTABLE}" "--config=${flake8_config}" "server"
)
endif() # PYTHON_STATIC_ANALYSIS