Initial commit
This commit is contained in:
13
deps/rapidcsv/examples/cmake-add-subdirectory/CMakeLists.txt
vendored
Normal file
13
deps/rapidcsv/examples/cmake-add-subdirectory/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
||||
project(cmake-addsubdirectory)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_subdirectory(rapidcsv)
|
||||
|
||||
add_executable(exprog2 src/exprog2.cpp)
|
||||
target_link_libraries(exprog2 PUBLIC rapidcsv)
|
||||
install(TARGETS exprog2 DESTINATION bin)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/bin/exprog2"
|
||||
)
|
11
deps/rapidcsv/examples/cmake-add-subdirectory/README.md
vendored
Normal file
11
deps/rapidcsv/examples/cmake-add-subdirectory/README.md
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
CMake Add Subdirectory Example Project
|
||||
======================================
|
||||
|
||||
Build Steps
|
||||
-----------
|
||||
Commands to build the example project:
|
||||
|
||||
ln -s ../.. rapidcsv
|
||||
mkdir -p build && cd build && cmake .. && make
|
||||
|
||||
|
11
deps/rapidcsv/examples/cmake-add-subdirectory/src/exprog2.cpp
vendored
Normal file
11
deps/rapidcsv/examples/cmake-add-subdirectory/src/exprog2.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