Skip to content

Commit f142b3e

Browse files
committed
Initial Project Commit
1 parent dded33f commit f142b3e

File tree

4 files changed

+443
-0
lines changed

4 files changed

+443
-0
lines changed

.gitignore

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,194 @@
11
# Created by .ignore support plugin (hsz.mobi)
2+
### CMake template
3+
CMakeCache.txt
4+
CMakeFiles
5+
CMakeScripts
6+
Testing
7+
Makefile
8+
cmake_install.cmake
9+
install_manifest.txt
10+
compile_commands.json
11+
CTestTestfile.cmake
12+
### C template
13+
# Prerequisites
14+
*.d
15+
16+
# Object files
17+
*.o
18+
*.ko
19+
*.obj
20+
*.elf
21+
22+
# Linker output
23+
*.ilk
24+
*.map
25+
*.exp
26+
27+
# Precompiled Headers
28+
*.gch
29+
*.pch
30+
31+
# Libraries
32+
*.lib
33+
*.a
34+
*.la
35+
*.lo
36+
37+
# Shared objects (inc. Windows DLLs)
38+
*.dll
39+
*.so
40+
*.so.*
41+
*.dylib
42+
43+
# Executables
44+
*.exe
45+
*.out
46+
*.app
47+
*.i*86
48+
*.x86_64
49+
*.hex
50+
51+
# Debug files
52+
*.dSYM/
53+
*.su
54+
*.idb
55+
*.pdb
56+
57+
# Kernel Module Compile Results
58+
*.mod*
59+
*.cmd
60+
.tmp_versions/
61+
modules.order
62+
Module.symvers
63+
Mkfile.old
64+
dkms.conf
65+
### Autotools template
66+
# http://www.gnu.org/software/automake
67+
68+
Makefile.in
69+
/ar-lib
70+
/mdate-sh
71+
/py-compile
72+
/test-driver
73+
/ylwrap
74+
75+
# http://www.gnu.org/software/autoconf
76+
77+
/autom4te.cache
78+
/autoscan.log
79+
/autoscan-*.log
80+
/aclocal.m4
81+
/compile
82+
/config.guess
83+
/config.h.in
84+
/config.sub
85+
/configure
86+
/configure.scan
87+
/depcomp
88+
/install-sh
89+
/missing
90+
/stamp-h1
91+
92+
# https://www.gnu.org/software/libtool/
93+
94+
/ltmain.sh
95+
96+
# http://www.gnu.org/software/texinfo
97+
98+
/texinfo.tex
99+
100+
# http://www.gnu.org/software/m4/
101+
102+
m4/libtool.m4
103+
m4/ltoptions.m4
104+
m4/ltsugar.m4
105+
m4/ltversion.m4
106+
m4/lt~obsolete.m4
107+
autom4te.cache
108+
### C++ template
109+
# Prerequisites
110+
*.d
111+
112+
# Compiled Object files
113+
*.slo
114+
*.lo
115+
*.o
116+
*.obj
117+
118+
# Precompiled Headers
119+
*.gch
120+
*.pch
121+
122+
# Compiled Dynamic libraries
123+
*.so
124+
*.dylib
125+
*.dll
126+
127+
# Fortran module files
128+
*.mod
129+
*.smod
130+
131+
# Compiled Static libraries
132+
*.lai
133+
*.la
134+
*.a
135+
*.lib
136+
137+
# Executables
138+
*.exe
139+
*.out
140+
*.app
141+
### JetBrains template
142+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
143+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
144+
145+
# User-specific stuff
146+
.idea/**/workspace.xml
147+
.idea/**/tasks.xml
148+
.idea/**/dictionaries
149+
.idea/**/shelf
150+
151+
# Sensitive or high-churn files
152+
.idea/**/dataSources/
153+
.idea/**/dataSources.ids
154+
.idea/**/dataSources.local.xml
155+
.idea/**/sqlDataSources.xml
156+
.idea/**/dynamic.xml
157+
.idea/**/uiDesigner.xml
158+
.idea/**/dbnavigator.xml
159+
160+
# Gradle
161+
.idea/**/gradle.xml
162+
.idea/**/libraries
163+
164+
# CMake
165+
cmake-build-debug/
166+
cmake-build-release/
167+
168+
# Mongo Explorer plugin
169+
.idea/**/mongoSettings.xml
170+
171+
# File-based project format
172+
*.iws
173+
174+
# IntelliJ
175+
out/
176+
177+
# mpeltonen/sbt-idea plugin
178+
.idea_modules/
179+
180+
# JIRA plugin
181+
atlassian-ide-plugin.xml
182+
183+
# Cursive Clojure plugin
184+
.idea/replstate.xml
185+
186+
# Crashlytics plugin (for Android Studio and IntelliJ)
187+
com_crashlytics_export_strings.xml
188+
crashlytics.properties
189+
crashlytics-build.properties
190+
fabric.properties
191+
192+
# Editor-based Rest Client
193+
.idea/httpRequests
194+

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
project(sxgd)
3+
set(CMAKE_VERBOSE_MAKEFILE on)
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
6+
7+
add_executable(sxgd main.cpp)
8+
9+
find_package(PkgConfig)
10+
if (PKG_CONFIG_FOUND)
11+
pkg_search_module(LIBINPUT REQUIRED libinput)
12+
endif ()
13+
14+
find_package(udev)
15+
find_package(spdlog)
16+
17+
target_link_libraries(sxgd ${LIBINPUT_LIBRARIES} ${UDEV_LIBRARIES})
18+
target_include_directories(sxgd PUBLIC ${LIBINPUT_INCLUDE_DIRS} ${UDEV_INCLUDE_DIRS})
19+
target_compile_options(sxgd PUBLIC ${LIBINPUT_CFLAGS_OTHER} ${UDEV_CFLAGS_OTHER})

cmake/Modules/Findudev.cmake

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# - try to find the udev library
2+
#
3+
# Cache Variables: (probably not for direct use in your scripts)
4+
# UDEV_INCLUDE_DIR
5+
# UDEV_SOURCE_DIR
6+
# UDEV_LIBRARY
7+
#
8+
# Non-cache variables you might use in your CMakeLists.txt:
9+
# UDEV_FOUND
10+
# UDEV_INCLUDE_DIRS
11+
# UDEV_LIBRARIES
12+
#
13+
# Requires these CMake modules:
14+
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
15+
#
16+
# Original Author:
17+
# 2014 Kevin M. Godby <[email protected]>
18+
#
19+
# Distributed under the Boost Software License, Version 1.0.
20+
# (See accompanying file LICENSE_1_0.txt or copy at
21+
# http://www.boost.org/LICENSE_1_0.txt)
22+
23+
set(UDEV_ROOT_DIR
24+
"${UDEV_ROOT_DIR}"
25+
CACHE
26+
PATH
27+
"Directory to search for udev")
28+
29+
find_package(PkgConfig QUIET)
30+
if(PKG_CONFIG_FOUND)
31+
pkg_check_modules(PC_LIBUDEV libudev)
32+
endif()
33+
34+
find_library(UDEV_LIBRARY
35+
NAMES
36+
udev
37+
PATHS
38+
${PC_LIBUDEV_LIBRARY_DIRS}
39+
${PC_LIBUDEV_LIBDIR}
40+
HINTS
41+
"${UDEV_ROOT_DIR}"
42+
PATH_SUFFIXES
43+
lib
44+
)
45+
46+
get_filename_component(_libdir "${UDEV_LIBRARY}" PATH)
47+
48+
find_path(UDEV_INCLUDE_DIR
49+
NAMES
50+
libudev.h
51+
PATHS
52+
${PC_LIBUDEV_INCLUDE_DIRS}
53+
${PC_LIBUDEV_INCLUDEDIR}
54+
HINTS
55+
"${_libdir}"
56+
"${_libdir}/.."
57+
"${UDEV_ROOT_DIR}"
58+
PATH_SUFFIXES
59+
include
60+
)
61+
62+
include(FindPackageHandleStandardArgs)
63+
find_package_handle_standard_args(UDEV
64+
DEFAULT_MSG
65+
UDEV_LIBRARY
66+
UDEV_INCLUDE_DIR
67+
)
68+
69+
if(UDEV_FOUND)
70+
list(APPEND UDEV_LIBRARIES ${UDEV_LIBRARY})
71+
list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
72+
mark_as_advanced(UDEV_ROOT_DIR)
73+
endif()
74+
75+
mark_as_advanced(UDEV_INCLUDE_DIR
76+
UDEV_LIBRARY)
77+

0 commit comments

Comments
 (0)