Skip to content

Commit 5015b1f

Browse files
2 parents 12664ef + b217774 commit 5015b1f

File tree

10 files changed

+2691
-3
lines changed

10 files changed

+2691
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ GNUmakefile.in
1515
/config.log
1616
/config.status
1717
/config/autoconf/
18+
/config/libsocketcan.pc
1819
/config/m4/libtool.m4
1920
/config/m4/ltoptions.m4
2021
/config/m4/ltsugar.m4

CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
cmake_minimum_required(VERSION 3.3)
22

33
project(can-utils LANGUAGES C)
4+
set(LIB_VERSION_MAJOR 2)
5+
set(LIB_VERSION_MINOR 2)
6+
set(LIB_VERSION_MICRO 1)
7+
set(LIB_VERSION ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_MICRO})
8+
set(VERSION 2018.10.0)
49

510
include (GNUInstallDirs)
611

@@ -73,6 +78,35 @@ add_library(j1939 STATIC
7378
libj1939.c
7479
)
7580

81+
add_library(socketcan SHARED
82+
libsocketcan.c
83+
)
84+
85+
set(prefix ${CMAKE_INSTALL_PREFIX})
86+
set(exec_prefix \${prefix})
87+
set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
88+
set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
89+
configure_file(config/libsocketcan.pc.in config/libsocketcan.pc @ONLY)
90+
install(
91+
FILES ${CMAKE_CURRENT_BINARY_DIR}/config/libsocketcan.pc
92+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
93+
)
94+
95+
set_target_properties(socketcan
96+
PROPERTIES PUBLIC_HEADER include/libsocketcan.h
97+
SOVERSION ${LIB_VERSION_MAJOR}
98+
VERSION ${LIB_VERSION}
99+
)
100+
101+
install(TARGETS socketcan
102+
LIBRARY
103+
DESTINATION lib
104+
NAMELINK_COMPONENT Development
105+
PUBLIC_HEADER
106+
DESTINATION include
107+
COMPONENT Development
108+
)
109+
76110
foreach(name ${PROGRAMS})
77111
add_executable(${name} ${name}.c)
78112

Documentation/main.dox

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @mainpage libsocketcan
2+
3+
This is libsocketcan, a userspace library to do some common tasks while dealing
4+
with the socketcan Framework.
5+
6+
@defgroup extern External API
7+
@defgroup intern Interally used callbacks and structures
8+
9+
*/

0 commit comments

Comments
 (0)