Giter Site home page Giter Site logo

CMake support about svgren HOT 3 OPEN

cppfw avatar cppfw commented on July 30, 2024 1
CMake support

from svgren.

Comments (3)

JaimeIvanCervantes avatar JaimeIvanCervantes commented on July 30, 2024 1

Hello @gdorion, I use CMake to compile svgren on my Mac, here are the contents of my CMakeLists.txt file:

cmake_minimum_required(VERSION 3.6)
project(code)

include_directories(./
	./svgren/
        ./svgdom/
        ./svgdom/elements/
        ./utki/
        ./papki/
	/usr/local/Cellar/cairo/1.14.10/include
	/usr/local/Cellar/cairo/1.14.10/include/cairo)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lcairo")

# Papki code
set(PAPKI_SOURCES
        papki/BufferFile.cpp
        papki/FSFile.cpp
        papki/File.cpp
        papki/MemoryFile.cpp)

# Mikroxml sources
set(MIKROXML_SOURCES
        mikroxml/mikroxml.cpp)
				
# Unikod source files
set(UNIKOD_SOURCES
        unikod/utf8.cpp)
				
# Svgren files
set(SVGREN_SOURCES
        svgren/render.cpp
	svgren/Renderer.cpp
	svgren/util.cpp
	svgren/FilterApplyer.cpp
	svgren/Surface.cpp
	svgren/CanvasRegion.cpp)

# Svgdom source files
set(SVGDOM_SOURCES
        svgdom/Length.cpp
        svgdom/Parser.cpp
        svgdom/StreamWriter.cpp
        svgdom/Visitor.cpp
        svgdom/dom.cpp
        svgdom/util.cpp
        svgdom/Finder.cpp
        svgdom/StyleStack.cpp
	svgdom/Cloner.cpp
        svgdom/elements/AspectRatioed.cpp
        svgdom/elements/ImageElement.cpp
        svgdom/elements/Element.cpp
        svgdom/elements/Gradients.cpp
        svgdom/elements/Rectangle.cpp
        svgdom/elements/Referencing.cpp
        svgdom/elements/Shapes.cpp
        svgdom/elements/Structurals.cpp
        svgdom/elements/Styleable.cpp
        svgdom/elements/Transformable.cpp
        svgdom/elements/ViewBoxed.cpp
        svgdom/elements/Filter.cpp)

# My main source file
set(MAIN_SOURCES
        main.cpp)

add_executable(code
        ${PAPKI_SOURCES}
        ${MIKROXML_SOURCES}
	${UNIKOD_SOURCES}
	${SVGREN_SOURCES}
        ${SVGDOM_SOURCES}
        ${MAIN_SOURCES})

As you can see, the only real dependency is cairo, all the other dependencies (utki, papki, mikroxml, unikod, and of course svgdom) are found on @igagis github repositories. I use this file only for debugging/testing, and have something more complicated for production, but you can easily adapt this to your requirements.

from svgren.

igagis avatar igagis commented on July 30, 2024

Hi!
I don't use CMake and I'm not really familiar with it, so I can't create CMake scripts. But I accept patches ;)

from svgren.

igagis avatar igagis commented on July 30, 2024

Just FYI, svgren is now available as conan package for linux and macos, this might be easier to use along with CMake.

from svgren.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.