forked from bobbydilley/JVSCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (40 loc) · 1.24 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
cmake_minimum_required(VERSION 3.10)
project(jvscore
VERSION "1.2.0"
LANGUAGES "C"
DESCRIPTION "Linux user space device driver for JVS I/O boards"
HOMEPAGE_URL "https://github.com/bobbydilley/JVSCore-Public"
)
find_package(Threads REQUIRED)
configure_file(include/version.h.in version.h)
include_directories(${THREAD_INLCUDE_DIRS} ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR})
FILE(GLOB Sources src/*.c) #Assume we want to include everything from src/
add_executable(${PROJECT_NAME}
${Sources}
docs/jvscore.conf
docs/jvscore.service
)
set_target_properties(${PROJECT_NAME} PROPERTIES
C_STANDARD 99
)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} m)
install(
TARGETS ${PROJECT_NAME}
COMPONENT binaries
RUNTIME DESTINATION "bin/"
LIBRARY DESTINATION "lib/"
)
install(
FILES docs/jvscore.conf
COMPONENT config
DESTINATION "etc/"
)
install(
FILES docs/jvscore.service
DESTINATION "/lib/systemd/system/"
COMPONENT config
)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]") #required
INCLUDE(CPack)