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
e2ab1369
Commit
e2ab1369
authored
12 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Fixed image conversion.
[[Imported from SVN: r6966]]
parent
735a2cdc
Branches
Branches containing commit
Tags
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
+31
-17
31 additions, 17 deletions
cmake/modules/FindInkscape.cmake
with
31 additions
and
17 deletions
cmake/modules/FindInkscape.cmake
+
31
−
17
View file @
e2ab1369
...
...
@@ -12,42 +12,56 @@
# 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'"
)
find_program
(
INKSCAPE inkscape DOC
"Path to inkscape to generate png files from svg files"
)
find_program
(
CONVERT convert DOC
"Path to convert program"
)
if
(
INKSCAPE
)
set
(
INKSCAPE_FOUND True
)
endif
(
INKSCAPE
)
include
(
CMakeParseArguments
)
function
(
inkscape_generate_png_from_svg
)
if
(
NOT INKSCAPE
)
return
()
endif
(
NOT INKSCAPE
)
include
(
CMakeParseArguments
)
cmake_parse_arguments
(
INKSCAPE
""
"OUTPUT_DIR DPI"
""
${
ARGN
}
)
cmake_parse_arguments
(
INKSCAPE
""
"OUTPUT_DIR;DPI"
""
${
ARGN
}
)
if
(
NOT INKSCAPE_OUTPUT_DIR
)
set
(
INKSCAPE_OUTPUT_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
NOT INKSCAPE_OUTPUT_DIR
)
if
(
NOT INKSCAPE_DPI
)
set
(
INKSCAPE_DPI 90
)
endif
(
NOT INKSCAPE_DPI
)
foreach
(
pic
${
INKSCAPE_UNPARSED_ARGUMENTS
}
)
string
(
REGEX REPLACE
"
\\
.[^.]+"
".svg"
input
${
pic
}
)
#message("pic=${pic} input=${input}")
add_custom_command
(
OUTPUT
${
pic
}
COMMAND
${
INKSCAPE
}
--export-dpi=
${
DPI
}
-e
${
pic
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
COMMENT
"Generating
${
pic
}
"
string
(
REGEX REPLACE
"
\\
.[a-zA-Z]+"
".svg"
input
${
pic
}
)
add_custom_command
(
OUTPUT
${
pic
}
COMMAND
${
INKSCAPE
}
--export-dpi=
${
INKSCAPE_DPI
}
-e
${
pic
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
DEPENDS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
COMMENT
"Generating
${
INKSCAPE_OUTPUT_DIR
}
/
${
pic
}
from
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
"
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
)
function
(
inkscape_generate_eps_from_svg
)
string
(
REGEX REPLACE
"
\\
.[^.]+"
".png"
PNGS
${
ARGN
}
)
inkscape_generate_png_from_svg
(
${
ARGN
}
)
cmake_parse_arguments
(
INKSCAPE
""
"OUTPUT_DIR DPI"
""
${
PNGS
}
)
cmake_parse_arguments
(
INKSCAPE
""
"INPUT_DIR;OUTPUT_DIR;DPI"
""
${
ARGN
}
)
if
(
NOT INKSCAPE_INPUT_DIR
)
set
(
INKSCAPE_INPUT_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endif
(
NOT INKSCAPE_INPUT_DIR
)
if
(
NOT INKSCAPE_INPUT_DIR
)
set
(
INKSCAPE_OUTPUT_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
NOT INKSCAPE_INPUT_DIR
)
foreach
(
_pic
${
INKSCAPE_UNPARSED_ARGUMENTS
}
)
string
(
REGEX REPLACE
"
\\
.[^.]+"
".png"
input
${
pic
}
)
add_custom_command
(
OUTPUT
${
pic
}
COMMAND
${
CONVERT
}
${
input
}
EPS:
${
pic
}
string
(
REGEX REPLACE
"
\\
.[a-zA-Z]+"
".png"
input
"
${
_pic
}
"
)
string
(
REGEX REPLACE
"
\\
.[a-zA-Z]+"
".svg"
svginput
"
${
_pic
}
"
)
add_custom_target
(
${
input
}
COMMAND
${
INKSCAPE
}
--export-dpi=
${
INKSCAPE_DPI
}
-e
${
input
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
svginput
}
COMMENT
"Generating
${
INKSCAPE_OUTPUT_DIR
}
/
${
pic
}
from
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
input
}
"
)
add_custom_command
(
OUTPUT
${
_pic
}
COMMAND
${
CONVERT
}
${
INKSCAPE_INPUT_DIR
}
/
${
input
}
EPS:
${
_pic
}
DEPENDS
${
input
}
COMMENT
"
Gen
er
a
ting {INKSCAPE_OUTPUT_DIR}/
${
pic
}
"
COMMENT
"
Conv
erting
${
INKSCAPE_INPUT_DIR
}
/
${
input
}
to
$
{
INKSCAPE_OUTPUT_DIR
}
/
${
_
pic
}
"
WORKING_DIRECTORY
${
INKSCAPE_OUTPUT_DIR
}
)
endforeach
(
_pic
${
INKSCAPE_UNPARSED_ARGUMENTS
}
)
endfunction
(
inkscape_generate_eps_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