Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dxfread (and DISABLED_DXF/WRITE source inclusion issues) #888

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,23 @@
src/in_json.c)
endif()

if(NOT LIBREDWG_DISABLE_DXF)
set(outdxf_SOURCES
src/out_dxf.c
src/out_dxfb.c)
set(indxf_SOURCES
src/in_dxf.c)
if(LIBREDWG_DISABLE_WRITE)
set(indxf_SOURCES
src/encode.c) # in_dxf depends on some functions
endif
endif()

Check failure on line 246 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / vs2019-ninja

Parse error. Expected "(", got newline with text "

if(NOT LIBREDWG_DISABLE_WRITE)
set(write_SOURCES
src/encode.c
src/in_dxf.c
${injson_SOURCES}
${outjson_SOURCES}
${outdxf_SOURCES}
src/reedsolomon.c)
endif()

Expand All @@ -257,9 +269,8 @@
src/dxfclasses.c
src/free.c
src/geom.c
src/out_dxf.c
${outjson_SOURCES}
src/out_dxfb.c
${indxf_SOURCES}
${injson_SOURCES}
${write_SOURCES}
src/print.c)

Expand Down Expand Up @@ -287,14 +298,21 @@
if(NOT HAVE_GETOPT_H)
set(getopt_c programs/getopt.c)
endif(NOT HAVE_GETOPT_H)
set(executables_TARGETS dwgread dwg2dxf dwggrep dwglayers dwgbmp dwg2SVG)
set(executables_TARGETS dwgread dwggrep dwglayers dwgbmp dwg2SVG)
add_executable(dwgread programs/dwgread.c ${getopt_c})
add_executable(dwg2dxf programs/dwg2dxf.c ${getopt_c})
if(NOT LIBREDWG_DISABLE_DXF)
add_executable(dxfread programs/dxfread.c ${getopt_c})
set(executables_TARGETS ${executables_TARGETS} dxfread)
if(NOT LIBREDWG_DISABLE_WRITE)
add_executable(dwg2dxf programs/dwg2dxf.c ${getopt_c})
add_executable(dxf2dwg programs/dxf2dwg.c ${getopt_c})
set(executables_TARGETS ${executables_TARGETS} dxf2dwg dwg2dxf)
endif(NOT LIBREDWG_DISABLE_WRITE)
endif(NOT LIBREDWG_DISABLE_DXF)
if(NOT LIBREDWG_DISABLE_WRITE)
add_executable(dwgrewrite programs/dwgrewrite.c ${getopt_c})
add_executable(dwgwrite programs/dwgwrite.c ${getopt_c})
add_executable(dxf2dwg programs/dxf2dwg.c ${getopt_c})
set(executables_TARGETS ${executables_TARGETS} dwgrewrite dwgwrite dxf2dwg)
set(executables_TARGETS ${executables_TARGETS} dwgrewrite dwgwrite)
endif(NOT LIBREDWG_DISABLE_WRITE)
add_executable(dwggrep programs/dwggrep.c ${getopt_c})
add_executable(dwglayers programs/dwglayers.c ${getopt_c})
Expand Down
2 changes: 2 additions & 0 deletions libredwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ fi
%{_bindir}/dwgread
%{_bindir}/dwgrewrite
%{_bindir}/dwgwrite
%{_bindir}/dxfread
%{_bindir}/dxf2dwg
%{_bindir}/dxfwrite
%{_libdir}/libredwg.so.0
Expand All @@ -151,6 +152,7 @@ fi
%{_mandir}/man1/dwgread.1.gz
%{_mandir}/man1/dwgrewrite.1.gz
%{_mandir}/man1/dwgwrite.1.gz
%{_mandir}/man1/dxfread.1.gz
%{_mandir}/man1/dxf2dwg.1.gz
%{_mandir}/man1/dxfwrite.1.gz
%{_mandir}/man5/dwg*
Expand Down
49 changes: 22 additions & 27 deletions programs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,40 @@ AM_CFLAGS = -I. -I$(top_srcdir)/include -I$(top_srcdir)/src $(WARN_CFLAGS)
LDADD = $(top_builddir)/src/libredwg.la
CPPCHECK = @CPPCHECK@

bin_PROGRAMS = dwgread
noinst_PROGRAMS =
dist_man1_MANS = $(srcdir)/dwgread.1
if !DISABLE_DXF
bin_PROGRAMS += dwgbmp dwg2dxf dwg2SVG dwglayers dwggrep
dist_bin_SCRIPTS = dwgfilter
dist_man1_MANS += $(srcdir)/dwgbmp.1 $(srcdir)/dwg2dxf.1 \
$(srcdir)/dwg2SVG.1 $(srcdir)/dwglayers.1 \
bin_PROGRAMS = dwglayers dwggrep
noinst_PROGRAMS =
dist_bin_SCRIPTS = dwgfilter
dist_man1_MANS = $(srcdir)/dwglayers.1 \
$(srcdir)/dwggrep.1 $(srcdir)/dwgfilter.1
endif

if !DISABLE_DXF
if HAVE_LIBPS
bin_PROGRAMS += dwg2ps
dist_man1_MANS += $(srcdir)/dwg2ps.1
dwg2ps_SOURCES = dwg2ps.c
dwg2ps_LDADD = $(LDADD) -lps
endif
endif

dwgread_SOURCES = dwgread.c
dwgbmp_SOURCES = dwgbmp.c
dwg2dxf_SOURCES = dwg2dxf.c
dwglayers_SOURCES = dwglayers.c
dwg2SVG_SOURCES = dwg2SVG.c escape.c
dwggrep_SOURCES = dwggrep.c
dwggrep_CFLAGS = $(AM_CFLAGS) $(CFLAGS) $(PCRE2_CFLAGS)
dwggrep_LDADD = $(LDADD) $(PCRE2_LIBS)

if USE_WRITE
bin_PROGRAMS += dwgrewrite
dist_man1_MANS += $(srcdir)/dwgrewrite.1
bin_PROGRAMS += dwgread dwgrewrite dwgwrite dwgbmp dwg2SVG
dist_man1_MANS += $(srcdir)/dwgread.1 $(srcdir)/dwgrewrite.1 \
$(srcdir)/dwgwrite.1 $(srcdir)/dwgbmp.1 $(srcdir)/dwg2SVG.1
dwgrewrite_SOURCES = dwgrewrite.c
dwgwrite_SOURCES = dwgwrite.c
dwgread_SOURCES = dwgread.c
dwgbmp_SOURCES = dwgbmp.c
dwg2SVG_SOURCES = dwg2SVG.c escape.c
if !DISABLE_DXF
bin_PROGRAMS += dxf2dwg dwgwrite dxfwrite
dist_man1_MANS += $(srcdir)/dxf2dwg.1 $(srcdir)/dwgwrite.1 $(srcdir)/dxfwrite.1
bin_PROGRAMS += dxf2dwg dwg2dxf dxfwrite dxfread
dist_man1_MANS += $(srcdir)/dxf2dwg.1 $(srcdir)/dwg2dxf.1 \
$(srcdir)/dxfwrite.1 $(srcdir)/dxfread.1
dxf2dwg_SOURCES = dxf2dwg.c
dwgwrite_SOURCES = dwgwrite.c
dxfread_SOURCES = dxfread.c
dxfwrite_SOURCES = dxfwrite.c
dwg2dxf_SOURCES = dwg2dxf.c
endif
if HAVE_LIBPS
bin_PROGRAMS += dwg2ps
dist_man1_MANS += $(srcdir)/dwg2ps.1
dwg2ps_SOURCES = dwg2ps.c
dwg2ps_LDADD = $(LDADD) -lps
endif
endif

Expand Down
18 changes: 18 additions & 0 deletions programs/alive.test.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ run ()
fi
fi
;;
dxfread) if [ -z "$DISABLE_JSON" ]; then
if [ -n "$addarg" ]; then
arg="-y -v2 $addarg -o $bdwg-$out.json $bdwg.dxf"
else
arg="-y -v2 $bdwg.dxf"
fi
else
if [ -n "$addarg" ]; then
arg="-y -v2 $addarg -o $bdwg-$out.dwg $bdwg.dxf"
else
arg="-y -v2 $dwg.dxf"
fi
fi
# no pre-r2 dxf yet (not sure this actually applies to reading)
if [ "$ddwg" = "r1.4" ]; then
return
fi
;;
dxfwrite) if [ -z "$DISABLE_JSON" ]; then
if [ -n "$addarg" ]; then
arg="-y -v2 $addarg -o $bdwg-$out.dxf $bdwg.json"
Expand Down
42 changes: 42 additions & 0 deletions programs/dxfread.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.TH DXFREAD "1" "November 2023" "dxfread 0.13.0" "User Commands"
.SH NAME
dxfread \- manual page for dxfread 0.13.0
.SH SYNOPSIS
.B dxfread
[\fI\,OPTION\/\fR]... \fI\,DXFFILE\/\fR
.SH DESCRIPTION
Reads the DXF into some optional output format to stdout or some file,
and prints error, success or verbose internal progress to stderr.
.TP
\fB\-v[0\-9]\fR, \fB\-\-verbose\fR [0\-9]
verbosity
.TP
\fB\-O\fR fmt, \fB\-\-format\fR fmt
fmt: DXF, DXFB, JSON, GeoJSON
.TP
Planned output formats:
YAML, XML/OGR, GPX, SVG, PS
.TP
\fB\-o\fR outfile
also defines the output fmt. Default: stdout
.TP
\fB\-\-help\fR
display this help and exit
.TP
\fB\-\-version\fR
output version information and exit
.PP
GNU LibreDWG online manual: <https://www.gnu.org/software/libredwg/>
.SH "SEE ALSO"
The full documentation for
.B dxfread
is maintained as a Texinfo manual. If the
.B info
and
.B dxfread
programs are properly installed at your site, the command
.IP
.B info LibreDWG
.PP
should give you access to the complete manual.
Loading
Loading