forked from OpenHantek/openhantek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (40 loc) · 1.73 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
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(OpenHantekProject)
cmake_policy(SET CMP0072 NEW)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Default build type
IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo)
ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
# Find external libraries
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")
INCLUDE_DIRECTORIES(".")
# Use CPack to make deb/rpm/zip/exe installer packages
include(cmake/CPackInfos.cmake)
# Qt Widgets based Gui with OpenGL canvas
add_subdirectory(openhantek)
if (WIN32)
install(FILES COPYING readme.md DESTINATION ".")
else()
add_subdirectory(firmware EXCLUDE_FROM_ALL)
endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
if(EXISTS "/lib/udev/rules.d/")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/firmware/60-hantek.rules"
DESTINATION "/lib/udev/rules.d/" COMPONENT Runtime)
else()
message(WARNING "Could not find udev rules directory (/lib/udev/rules.d/), skipping installation of udev rules.")
endif()
endif()
# Add auxiliary files to the project, so that these files appear in VisualStudio/QtCreator
file(GLOB_RECURSE MDFILES "docs/*.md" "openhantek/*.md")
add_custom_target(readme SOURCES readme.md ${MDFILES})
# Add "cppcheck" command
add_custom_target(cppcheck COMMAND "cppcheck --enable=all -I \"${CMAKE_CURRENT_LIST_DIR}/openhantek/src\" -q ${SRC} --template=\"{file}:{line}: {severity}: {message}\"")
# Add "doc" target to build the documentation.
find_package(Doxygen QUIET)
if (DOXYGEN_FOUND)
add_custom_target(doc
COMMAND "${CMAKE_COMMAND} -E remove_directory html"
COMMAND "${DOXYGEN_EXECUTABLE} Doxyfile" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
endif()