From 32f7c2bec0499186b5133190d11f74cf8cacf05a Mon Sep 17 00:00:00 2001 From: Will Eccles Date: Fri, 10 May 2024 12:05:34 -0400 Subject: [PATCH] initial project setup --- .gitignore | 14 +++++++++++ CMakeLists.txt | 49 ++++++++++++++++++++++++++++++++++++ include/bci/abs/ScpiDriver.h | 15 +++++++++++ src/ScpiDriver.cpp | 9 +++++++ 4 files changed, 87 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 include/bci/abs/ScpiDriver.h create mode 100644 src/ScpiDriver.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07148ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps +CMakeUserPresets.json +build +.cache diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..55c0df2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.14) + +project("ABS SCPI Driver" VERSION 0.0.1) + +include(FetchContent) + +find_package(fmt 10.2.0 QUIET) +if(NOT fmt_FOUND) + FetchContent_Declare(fmt + GIT_REPOSITORY https://github.com/fmtlib/fmt.git + GIT_TAG 10.2.1 + GIT_SHALLOW TRUE + ) + FetchContent_GetProperties(fmt) + if(NOT fmt_POPULATED) + message(STATUS "Fetch fmt") + FetchContent_Populate(fmt) + add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR} EXCLUDE_FROM_ALL) + endif() +endif() + +find_package(Boost 1.81.0 COMPONENTS system QUIET) +if (NOT Boost_FOUND) + set(BOOST_INCLUDE_LIBRARIES system asio) + set(BOOST_ENABLE_CMAKE ON) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + cmake_policy(SET CMP0135 NEW) + endif() + FetchContent_Declare(Boost + SYSTEM + URL https://github.com/boostorg/boost/releases/download/boost-1.81.0/boost-1.81.0.tar.gz + URL_HASH "SHA1=f71f661f893f39b7b82d66c54980349716f874a2" + ) + FetchContent_GetProperties(Boost) + if(NOT Boost_POPULATED) + message(STATUS "Fetch Boost (may take a while)") + FetchContent_MakeAvailable(Boost) + endif() +endif() + +add_library(bciabs_scpi src/ScpiDriver.cpp) + +target_compile_features(bciabs_scpi PUBLIC cxx_std_20) + +target_compile_options(bciabs_scpi PRIVATE -Wall -Wextra) + +target_include_directories(bciabs_scpi PUBLIC ${PROJECT_SOURCE_DIR}/include) + +target_link_libraries(bciabs_scpi PRIVATE fmt::fmt-header-only) diff --git a/include/bci/abs/ScpiDriver.h b/include/bci/abs/ScpiDriver.h new file mode 100644 index 0000000..e98c5f4 --- /dev/null +++ b/include/bci/abs/ScpiDriver.h @@ -0,0 +1,15 @@ +#ifndef ABS_SCPI_DRIVER_INCLUDE_BCI_ABS_SCPIDRIVER_H +#define ABS_SCPI_DRIVER_INCLUDE_BCI_ABS_SCPIDRIVER_H + +namespace bci::abs { + +class ScpiDriver { + public: + ScpiDriver(); + + ~ScpiDriver(); +}; + +} // namespace bci::abs + +#endif /* ABS_SCPI_DRIVER_INCLUDE_BCI_ABS_SCPIDRIVER_H */ diff --git a/src/ScpiDriver.cpp b/src/ScpiDriver.cpp new file mode 100644 index 0000000..2aa8741 --- /dev/null +++ b/src/ScpiDriver.cpp @@ -0,0 +1,9 @@ +#include + +namespace bci::abs { + +ScpiDriver::ScpiDriver() {} + +ScpiDriver::~ScpiDriver() {} + +} // namespace bci::abs