sammycage / lunasvg

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

How to add this library as external using git submodule? #23

Closed lwyj123 closed 3 years ago

lwyj123 commented 3 years ago

I cannot find variables like LUNASVG_INCLUDE_DIRS and LUNASVG_LIBRARIES to use.

add_subdirectory(${EXTERNAL_DIR}/lunasvg)
target_include_directories(main PRIVATE ${LUNASVG_INCLUDE_DIRS})
target_link_libraries(main ${LUNASVG_LIBRARIES})
sammycage commented 3 years ago
add_subdirectory(${EXTERNAL_DIR}/lunasvg)
target_link_libraries(main lunasvg)

Lemme known if it works :smiley:

lwyj123 commented 3 years ago
add_subdirectory(${EXTERNAL_DIR}/lunasvg)
target_link_libraries(main lunasvg)

Lemme known if it works 😃

Thanks for your answer.

If I use this way, I need to build and install the package firstly.

cd lunasvg
mkdir build
cd build
make -j 2
make install

But the other package I used before, I don't need to do that things manually. is the command mentioned above necessary?

sammycage commented 3 years ago

No.. You don't need to build lunasvg separately anymore. The main CMakeList.txt will build it for you.

lwyj123 commented 3 years ago

OK, I used this method before but it does't work, I will check this method later again.

lwyj123 commented 3 years ago

@sammycage I just got this error

image

And I need to run make install myself

image

sammycage commented 3 years ago

#include <svgdocument.h> not #include <lunasvg/svgdocument.h>

lwyj123 commented 3 years ago

@sammycage not works. image

And I get the include code from https://github.com/sammycage/lunasvg/issues/18, will the usage be different?

lwyj123 commented 3 years ago

Oh, I just updated the submodule, It works. Seems the update https://github.com/sammycage/lunasvg/commit/35cf0a2c986d6dba789e364bff099d394c096e6d change the behavior.

lwyj123 commented 3 years ago

Could you update the documents for later users if you have the time?