Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
341884e9
Commit
341884e9
authored
12 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Allow specification of an output directory.
[[Imported from SVN: r6900]]
parent
9f742fc9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/FindInkscape.cmake
+28
-0
28 additions, 0 deletions
cmake/modules/FindInkscape.cmake
with
28 additions
and
0 deletions
cmake/modules/FindInkscape.cmake
+
28
−
0
View file @
341884e9
...
...
@@ -4,5 +4,33 @@
#
# INSCAPE: Path to inkscape to generate .png's form .svg's
#
# Provides the following functions:
#
# inkscape_generate_png_from_svg([OUTPUT_DIR <output_dir>] <pngfile1.png> [<pngfile2.png> ....])
#
# Generates pngfile1, ... from svg input files pngfile1.svg, ....
# The output directory can be specified with the option OUTPUT_DIR. If it is omitted
# the files will be generated in CMAKE_CURRENT_BINARY_DIR.
find_program
(
INKSCAPE inkscape DOC
"Path to inkscape to generate .png's form .svg'"
)
function
(
inkscape_generate_png_from_svg
)
if
(
NOT INKSCAPE
)
return
()
endif
(
NOT INKSCAPE
)
include
(
CMakeParseArguments
)
cmake_parse_arguments
(
INKSCAPE
""
"OUTPUT_DIR"
""
${
ARGN
}
)
if
(
NOT INKSCAPE_OUTPUT_DIR
)
set
(
INKSCAPE_OUTPUT_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
NOT INKSCAPE_OUTPUT_DIR
)
foreach
(
pic
${
INKSCAPE_UNPARSED_ARGUMENTS
}
)
string
(
REGEX REPLACE
"
\\
.[^.]+"
".svg"
input
${
pic
}
)
message
(
"pic=
${
pic
}
input=
${
input
}
"
)
add_custom_command
(
OUTPUT
${
pic
}
COMMAND
${
INKSCAPE
}
-e
${
pic
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
COMMENT
"Generating
${
pic
}
"
WORKING_DIRECTORY
${
INKSCAPE_OUTPUT_DIR
}
)
message
(
" add_custom_command(OUTPUT
${
pic
}
COMMAND
${
INKSCAPE
}
-e
${
pic
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
COMMENT
\"
Generating
${
pic
}
\"
WORKING_DIRECTORY
${
INKSCAPE_OUTPUT_DIR
}
)"
)
endforeach
(
pic
)
endfunction
(
inkscape_generate_png_from_svg
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment