Initial commit
This commit is contained in:
19
deps/rapidcsv/examples/cmake-fetchcontent/CMakeLists.txt
vendored
Normal file
19
deps/rapidcsv/examples/cmake-fetchcontent/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
||||
project(cmake-fetchcontent)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
rapidcsv
|
||||
GIT_REPOSITORY "https://github.com/d99kris/rapidcsv.git"
|
||||
GIT_TAG "v8.50"
|
||||
)
|
||||
FetchContent_MakeAvailable(rapidcsv)
|
||||
|
||||
add_executable(exprog src/exprog.cpp)
|
||||
target_link_libraries(exprog PUBLIC rapidcsv)
|
||||
install(TARGETS exprog DESTINATION bin)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/bin/exprog"
|
||||
)
|
10
deps/rapidcsv/examples/cmake-fetchcontent/README.md
vendored
Normal file
10
deps/rapidcsv/examples/cmake-fetchcontent/README.md
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
CMake FetchContent Example Project
|
||||
==================================
|
||||
|
||||
Build Steps
|
||||
-----------
|
||||
Commands to build the example project:
|
||||
|
||||
mkdir -p build && cd build && cmake .. && make
|
||||
|
||||
|
11
deps/rapidcsv/examples/cmake-fetchcontent/src/exprog.cpp
vendored
Normal file
11
deps/rapidcsv/examples/cmake-fetchcontent/src/exprog.cpp
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <rapidcsv.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
rapidcsv::Document doc("../../colhdr.csv");
|
||||
|
||||
std::vector<float> col = doc.GetColumn<float>("Close");
|
||||
std::cout << "Read " << col.size() << " values." << std::endl;
|
||||
}
|
Reference in New Issue
Block a user