sammycage / lunasvg

SVG rendering and manipulation library in C++
MIT License
866 stars 124 forks source link

CMake modernization #84

Closed seanharmer closed 1 year ago

seanharmer commented 2 years ago

These changes makes it much easier to use lunasvg in downstream projects either by hand or via CMake's FetchContent.

sammycage commented 2 years ago

Wonderful work... I'll take a closer look. <3

seanharmer commented 2 years ago

Have you had a chance to take a look at this please?

fdwr commented 2 years ago

@seanharmer

seanharmer commented 2 years ago
  • Will include(GNUInstallDirs) bork the CMakeLists.txt for me on Windows?

I think it's fine. It just helps put the build artifacts under install dir/bin install dir/include etc. It worked for me on Windows anyway.

  • Where is lunasvg_export.h defined? (or lunasvgexport.h per existing naming conventions) I don't see it in this PR.

Ah right. This header file is generated into the build dir when you run cmake. The line that generates it is:

include(GenerateExportHeader)
generate_export_header(lunasvg)

It just saves us hand crafting a suitable export header for shared/static libs. The full documentation is at:

https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html

Hope this helps! :)

Pospelove commented 1 year ago

Good job. This is an important change. Hope it lands at some point :)

sammycage commented 1 year ago

Thank you, @seanharmer. I apologize for the delay in responding.