-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in progress changes. Almost working?
Signed-off-by: David Rebbe <[email protected]>
- Loading branch information
1 parent
679870b
commit 4c36781
Showing
48 changed files
with
80 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[submodule "hidapi"] | ||
path = hidapi | ||
path = libneoradio2/hidapi | ||
url = https://github.com/libusb/hidapi.git | ||
[submodule "test/ice"] | ||
path = test/ice | ||
path = libneoradio2/test/ice | ||
url = https://github.com/ic3man5/ice.git | ||
[submodule "neoRAD-IO2-FrameDescription"] | ||
path = neoRAD-IO2-FrameDescription | ||
path = libneoradio2/neoRAD-IO2-FrameDescription | ||
url = https://github.com/emende-intrepid/neoRAD-IO2-FrameDescription.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
cmake_minimum_required (VERSION 3.25) | ||
|
||
project (libneoradio2_all LANGUAGES C CXX) | ||
|
||
include(GNUInstallDirs) | ||
option(BUILD_PYTHON_BINDINGS "Enable Python bindings" OFF) | ||
|
||
add_definitions(-DLIBNEORADIO2_EXPORTS) | ||
add_subdirectory(libneoradio2) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
|
||
|
||
file(READ "version.txt" ver) | ||
|
||
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ "${ver}") | ||
set(ver_major ${CMAKE_MATCH_1}) | ||
|
||
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ "${ver}") | ||
set(ver_minor ${CMAKE_MATCH_1}) | ||
|
||
string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ "${ver}") | ||
set(ver_patch ${CMAKE_MATCH_1}) | ||
|
||
message("VERSION DETECTED: ${ver_major}.${ver_minor}.${ver_patch}") | ||
|
||
project(neoradio2 | ||
VERSION "${ver_major}.${ver_minor}.${ver_patch}" | ||
DESCRIPTION "C Library to interface to neoRAD-IO-2 Devices") | ||
|
||
set(CMAKE_C_VISIBILITY_PRESET hidden) | ||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
|
||
include_directories(${PROJECT_SOURCE_DIR}/hidapi/hidapi) | ||
add_library(neoradio2 SHARED | ||
${PROJECT_SOURCE_DIR}/fifo.c | ||
${PROJECT_SOURCE_DIR}/device.cpp | ||
${PROJECT_SOURCE_DIR}/hiddevice.cpp | ||
${PROJECT_SOURCE_DIR}/libneoradio2.cpp | ||
${PROJECT_SOURCE_DIR}/neoradio2device.cpp) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
target_sources(neoradio2 PRIVATE ${PROJECT_SOURCE_DIR}/hidapi/linux/hid.c) | ||
find_library(UDEV_LIB_PATH udev) | ||
message("UDEV LIBRARY PATH: ${UDEV_LIB_PATH}") | ||
if(NOT UDEV_LIB_PATH) | ||
message(FATAL_ERROR "udev not found, try running 'sudo apt install libudev-dev'") | ||
endif() | ||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
target_sources(neoradio2 PRIVATE ${PROJECT_SOURCE_DIR}/hidapi/windows/hid.c) | ||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
target_sources(neoradio2 PRIVATE ${PROJECT_SOURCE_DIR}/hidapi/mac/hid.c) | ||
endif() | ||
|
||
set_target_properties(neoradio2 PROPERTIES | ||
VERSION ${PROJECT_VERSION} | ||
SOVERSION 1 | ||
C_VISIBILITY hidden | ||
CXX_VISIBILITY hidden) | ||
|
||
set_property(TARGET neoradio2 PROPERTY PUBLIC_HEADER libneoradio2.h libneoradio2common.h radio2_frames.h neoRAD-IO2-AIN.h) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
target_link_libraries(neoradio2 PRIVATE udev) | ||
endif() | ||
|
||
if (APPLE) | ||
target_link_libraries(neoradio2 "-framework CoreFoundation") | ||
target_link_libraries(neoradio2 "-framework IOKit") | ||
set_target_properties(neoradio2 PROPERTIES LINK_FLAGS "-Wl,-F/Library/Frameworks") | ||
endif() | ||
|
||
configure_file(libneoradio2.pc.in libneoradio2.pc @ONLY) | ||
|
||
install(TARGETS neoradio2 | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
install(FILES ${CMAKE_BINARY_DIR}/libneoradio2.pc | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) | ||
|
||
add_subdirectory(${PROJECT_SOURCE_DIR}/example) | ||
if (BUILD_PYTHON_BINDINGS) | ||
add_subdirectory(python) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.