Skip to content

Commit 69fd19c

Browse files
committed
add example, add uninstall, update doc, bump version
1 parent 583dd1c commit 69fd19c

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,11 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
241241
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rapidcsvConfig.cmake DESTINATION cmake)
242242

243243
# Uninstall
244-
add_custom_target(uninstall COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/include/rapidcsv.h"
245-
)
244+
add_custom_target(uninstall
245+
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/include/rapidcsv.h"
246+
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/cmake/rapidcsvConfig.cmake"
247+
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/cmake/rapidcsvTargets.cmake"
248+
)
246249
else()
247250
message(STATUS "Install/uninstall targets disabled.")
248251
endif()

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,16 @@ codecvt and sets HAS_CODECVT as needed, see [CMakeLists.txt](CMakeLists.txt)
429429
for reference. When enabled, the UTF-16 encoding of any loaded file is
430430
automatically detected.
431431
432-
CMake FetchContent
433-
------------------
434-
Rapidcsv may be included in a CMake project using FetchContent. Refer to the
435-
[CMake FetchContent Example Project](examples/cmake-fetchcontent) and in
436-
particular its [CMakeLists.txt](examples/cmake-fetchcontent/CMakeLists.txt).
432+
CMake
433+
-----
434+
Rapidcsv may be included in a CMake project using various methods:
435+
436+
- Add Subdirectory: [Example Project](examples/cmake-add-subdirectory) /
437+
[CMakeLists.txt](examples/cmake-add-subdirectory/CMakeLists.txt)
438+
- Fetch Content: [Example Project](examples/cmake-fetchcontent) /
439+
[CMakeLists.txt](examples/cmake-fetchcontent/CMakeLists.txt)
440+
- Find Package: [Example Project](examples/cmake-find-package) /
441+
[CMakeLists.txt](examples/cmake-find-package/CMakeLists.txt)
437442
438443
Locale Independent Parsing
439444
--------------------------
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
2+
project(cmake-find-package)
3+
set(CMAKE_CXX_STANDARD 11)
4+
5+
find_package(rapidcsv REQUIRED)
6+
add_executable(exprog3 src/exprog3.cpp)
7+
target_link_libraries(exprog3 PRIVATE rapidcsv::rapidcsv)
8+
9+
install(TARGETS exprog3 DESTINATION bin)
10+
add_custom_target(uninstall
11+
COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/bin/exprog2"
12+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CMake Find Package Example Project
2+
==================================
3+
4+
Build Steps
5+
-----------
6+
Commands to build the example project:
7+
8+
pushd ../../ ; ./make.sh install ; popd
9+
mkdir -p build && cd build && cmake .. && make
10+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <iostream>
2+
#include <vector>
3+
#include <rapidcsv.h>
4+
5+
int main()
6+
{
7+
rapidcsv::Document doc("../../colhdr.csv");
8+
9+
std::vector<float> col = doc.GetColumn<float>("Close");
10+
std::cout << "Read " << col.size() << " values." << std::endl;
11+
}

src/rapidcsv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* rapidcsv.h
33
*
44
* URL: https://github.com/d99kris/rapidcsv
5-
* Version: 8.91
5+
* Version: 8.92
66
*
77
* Copyright (C) 2017-2026 Kristofer Berggren
88
* All rights reserved.

0 commit comments

Comments
 (0)