1
- # Copyright 2012 OSMOCOM Project
2
- #
3
- # This file is part of rtl-sdr
4
- #
5
- # GNU Radio is free software; you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation; either version 3, or (at your option)
8
- # any later version.
9
- #
10
- # GNU Radio is distributed in the hope that it will be useful,
1
+ # rtl_433 is distributed in the hope that it will be useful,
11
2
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
3
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
4
# GNU General Public License for more details.
22
13
# Project setup
23
14
########################################################################
24
15
cmake_minimum_required (VERSION 2.6)
25
- project (rtlsdr C)
16
+ project (rtl433 C)
17
+ set (rtl433_VERSION_MAJOR 1)
18
+ set (rtl433_VERSION_MINOR 0)
26
19
27
20
#select the release build type by default to get optimization flags
28
21
if (NOT CMAKE_BUILD_TYPE )
@@ -50,32 +43,16 @@ endif()
50
43
# Find build dependencies
51
44
########################################################################
52
45
find_package (PkgConfig)
53
- find_package (LibUSB)
54
- set (THREADS_USE_PTHREADS_WIN32 true )
55
- find_package (Threads)
46
+ find_package (LibRTLSDR)
56
47
57
- if (NOT LIBUSB_FOUND)
58
- message (FATAL_ERROR "LibUSB 1.0 required to compile rtl-sdr" )
59
- endif ()
60
- if (NOT THREADS_FOUND)
61
- message (FATAL_ERROR "pthreads(-win32) required to compile rtl-sdr" )
62
- endif ()
63
48
########################################################################
64
49
# Setup the include and linker paths
65
50
########################################################################
66
51
include_directories (
67
52
${CMAKE_SOURCE_DIR} /include
68
- ${LIBUSB_INCLUDE_DIR}
69
- ${THREADS_PTHREADS_INCLUDE_DIR}
53
+ ${LIBRTLSDR_INCLUDE_DIRS}
70
54
)
71
55
72
- #link_directories(
73
- # ...
74
- #)
75
-
76
- # Set component parameters
77
- #set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE)
78
-
79
56
########################################################################
80
57
# Create uninstall target
81
58
########################################################################
@@ -88,58 +65,28 @@ add_custom_target(uninstall
88
65
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR} /cmake_uninstall.cmake
89
66
)
90
67
91
- ########################################################################
92
- # Install udev rules
93
- ########################################################################
94
- option (INSTALL_UDEV_RULES "Install udev rules for RTL-SDR" OFF )
95
- if (INSTALL_UDEV_RULES)
96
- install (
97
- FILES rtl-sdr.rules
98
- DESTINATION "/etc/udev/rules.d"
99
- COMPONENT "udev"
100
- )
101
- else (INSTALL_UDEV_RULES)
102
- message (STATUS "Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON" )
103
- endif (INSTALL_UDEV_RULES)
104
-
105
68
########################################################################
106
69
# Add subdirectories
107
70
########################################################################
108
71
add_subdirectory (include )
109
72
add_subdirectory (src)
110
73
111
- ########################################################################
112
- # Create Pkg Config File
113
- ########################################################################
114
- FOREACH (inc ${LIBUSB_INCLUDE_DIR} )
115
- LIST (APPEND RTLSDR_PC_CFLAGS "-I${inc} " )
116
- ENDFOREACH (inc)
117
-
118
- FOREACH (lib ${LIBUSB_LIBRARY_DIRS} )
119
- LIST (APPEND RTLSDR_PC_LIBS "-L${lib} " )
120
- ENDFOREACH (lib)
121
-
122
74
# use space-separation format for the pc file
123
- STRING (REPLACE ";" " " RTLSDR_PC_CFLAGS "${RTLSDR_PC_CFLAGS } " )
124
- STRING (REPLACE ";" " " RTLSDR_PC_LIBS "${RTLSDR_PC_LIBS } " )
75
+ STRING (REPLACE ";" " " RTL433_PC_CFLAGS "${RTL433_PC_CFLAGS } " )
76
+ STRING (REPLACE ";" " " RTL433_PC_LIBS "${RTL433_PC_LIBS } " )
125
77
126
78
# unset these vars to avoid hard-coded paths to cross environment
127
79
IF (CMAKE_CROSSCOMPILING )
128
- UNSET (RTLSDR_PC_CFLAGS )
129
- UNSET (RTLSDR_PC_LIBS )
80
+ UNSET (RTL433_PC_CFLAGS )
81
+ UNSET (RTL433_PC_LIBS )
130
82
ENDIF (CMAKE_CROSSCOMPILING )
131
83
132
84
set (prefix ${CMAKE_INSTALL_PREFIX} )
133
85
set (exec_prefix \${prefix} )
134
86
set (libdir \${exec_prefix} /lib)
135
87
set (includedir \${prefix} /include )
136
88
137
- CONFIGURE_FILE (
138
- ${CMAKE_CURRENT_SOURCE_DIR} /librtlsdr.pc.in
139
- ${CMAKE_CURRENT_BINARY_DIR} /librtlsdr.pc
140
- @ONLY)
141
-
142
89
INSTALL (
143
- FILES ${CMAKE_CURRENT_BINARY_DIR} /librtlsdr.pc
90
+ FILES
144
91
DESTINATION lib/pkgconfig
145
92
)
0 commit comments