Skip to content

Commit

Permalink
initial project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
willeccles committed May 10, 2024
1 parent acbe15d commit 32f7c2b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions include/bci/abs/ScpiDriver.h
Original file line number Diff line number Diff line change
@@ -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 */
9 changes: 9 additions & 0 deletions src/ScpiDriver.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <bci/abs/ScpiDriver.h>

namespace bci::abs {

ScpiDriver::ScpiDriver() {}

ScpiDriver::~ScpiDriver() {}

} // namespace bci::abs

0 comments on commit 32f7c2b

Please sign in to comment.