mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-03 05:55:18 +01:00
Refactor HackRF build system with a more modern CMake style. Install files to allow library users using CMake to find_project(HackRF CONFIG) and obtain HackRF::hackrf and/or HackRF::hackrf_static library targets. Add options ENABLE_STATIC_LIB and ENABLE_SHARED_LIB to allow shared or static library to be disabled. (Default builds both shared and static libraries.) Add option ENABLE_HACKRF_SWEEP, when disabled allows building without FFT library. (Default enabled.) Add option DISABLE_USB_DEVICE_DISCOVERY for a compile definition which could be used to alter libusb usage as needed on Android.
26 lines
779 B
CMake
26 lines
779 B
CMake
# top dir cmake project for libhackrf + tools
|
|
|
|
cmake_minimum_required(VERSION 3.10.0)
|
|
project(HackRF C)
|
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
set(CMAKE_C_FLAGS
|
|
"$ENV{CFLAGS}"
|
|
CACHE STRING "C Flags")
|
|
|
|
add_subdirectory(libhackrf)
|
|
add_subdirectory(hackrf-tools)
|
|
|
|
# ##############################################################################
|
|
# Create uninstall target
|
|
# ##############################################################################
|
|
|
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake @ONLY)
|
|
|
|
add_custom_target(
|
|
uninstall
|
|
COMMENT "Provide uninstall target"
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|