-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (19 loc) · 1.03 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
cmake_minimum_required(VERSION 2.8.12)
project(pa3_huffman)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# === src dependencies ===
include_directories(subprojects/cxxopts)
# === end src dependencies ===
add_subdirectory(src)
# === test dependencies ===
enable_testing()
add_subdirectory(subprojects/googletest-release-1.8.1)
# === end test dependencies ===
add_subdirectory(test)
# === custom commands ===
add_custom_target(cov COMMAND ${CMAKE_CURRENT_LIST_DIR}/build_scripts/generate_coverage_report -r "make" "make test")
add_custom_target(format COMMAND ${CMAKE_CURRENT_LIST_DIR}/build_scripts/run-clang-format.py -i -r ${CMAKE_CURRENT_LIST_DIR}/src ${CMAKE_CURRENT_LIST_DIR}/test)
add_custom_target(scan-build COMMAND scan-build make)
add_custom_target(cppcheck COMMAND cppcheck --enable=all --std=c++14 --error-exitcode=1 --suppress=missingInclude ${CMAKE_CURRENT_LIST_DIR}/src ${CMAKE_CURRENT_LIST_DIR}/test)