nemtrif / utfcpp

UTF-8 with C++ in a Portable Way
Boost Software License 1.0
1.58k stars 200 forks source link

CMake could be added to documentation #123

Closed rexkogitans closed 7 months ago

rexkogitans commented 7 months ago

Maybe my issue sounds quite stupid, but I am struggling to get UTF8CPP working with CMake. In the file CMakeLists.txt, I added these two lines:

find_package(utf8cpp REQUIRED)
include_directories(/usr/include/utf8cpp)

Then I can use

#include <utf8.h>

This is working, but hardcoding the include directories cannot be the right way to go. There is variable called utf8cpp_DIR which is set to /usr/share/utf8cpp/cmake. This directory includes 3 files which contain CMake rules, but I am not able to figure out how to use it.

I kindly ask to drop some lines about how to use CMake to build a project which uses UTF8CPP in the documentation.

nemtrif commented 7 months ago

https://github.com/nemtrif/utfcpp?tab=readme-ov-file#installation