build: get doxygen generating selective
authorWonki Kim <wonki_.kim@samsung.com>
Tue, 11 Aug 2020 08:52:14 +0000 (17:52 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Thu, 27 Aug 2020 05:00:13 +0000 (14:00 +0900)
doxygen documentation is always generated once doxygen has been adopted to this project.
this patch modifies some build scripts to get it selective.

Change-Id: I9a432b811f1d13e6ebcadf93321cfe2c7e9fc7ae

meson.build
meson_options.txt
packaging/aurum.spec

index 962193b..7867172 100644 (file)
@@ -29,11 +29,6 @@ configure_file(
   configuration: config_h
 )
 
-doxygen = find_program('doxygen', required: false)
-if not doxygen.found()
-   error('doxygen not found')
-endif
-
 dconf = configuration_data()
 dconf.set('VERSION', meson.project_version())
 if find_program('dot', required : false).found()
@@ -42,4 +37,10 @@ else
    dconf.set('HAVE_DOT', 'NO')
 endif
 
-subdir('doc')
+if get_option('enable_documentation') == true
+  doxygen = find_program('doxygen', required: false)
+  if not doxygen.found()
+    error('doxygen not found')
+  endif
+  subdir('doc')
+endif
index 89a5aec..726ed1d 100644 (file)
@@ -19,4 +19,10 @@ option('tizen_gcov',
   type: 'boolean',
   value: false,
   description: 'enable tizen specific gcov configuration'
-)
\ No newline at end of file
+)
+
+option('enable_documentation',
+  type: 'boolean',
+  value: false,
+  description: 'enable generating documentation by using doxygen'
+)
index d49226c..9355f32 100644 (file)
@@ -8,7 +8,6 @@ Source:         %{name}-%{version}.tar.gz
 Source1001:     %{name}.manifest
 
 BuildRequires:  meson
-BuildRequires:  doxygen
 BuildRequires:  pkgconfig(grpc)
 BuildRequires:  pkgconfig(grpc++)
 
@@ -30,6 +29,10 @@ BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(capi-system-system-settings)
 BuildRequires: pkgconfig(capi-base-utils-i18n)
 
+%if 0%{?gendoc:1}
+BuildRequires:  doxygen
+%endif
+
 %if 0%{?gcov:1}
 BuildRequires:  lcov
 %endif
@@ -66,6 +69,7 @@ Requires: libgrpc
 %description bootstrap
 gRPC Server
 
+%if 0%{?gendoc:1}
 %package docs
 Summary: documentation
 License: Apache-2.0
@@ -74,6 +78,7 @@ Requires: libgrpc
 
 %description docs
 documentations for aurum
+%endif
 
 %if 0%{?gcov:1}
 %package gcov
@@ -105,11 +110,17 @@ export LDFLAGS+=" -lgcov"
 %define TIZEN_GCOV false
 %endif
 
+%if 0%{?gendoc:1}
+%define TIZEN_GEN_DOC true
+%else
+%define TIZEN_GEN_DOC false
+%endif
 meson \
     --prefix /usr \
     --libdir %{_libdir} \
     -Dcpp_std=c++17 \
     -Dtizen=true \
+    -Denable_documentation=%{TIZEN_GEN_DOC} \
     -Dtizen_gcov=%{TIZEN_GCOV} \
     -Dtzapp_path=%{TZ_SYS_RO_APP} \
     -Dtzpackage_path=%{TZ_SYS_RO_PACKAGES} \
@@ -194,11 +205,13 @@ echo "signing %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap"
 %{TZ_SYS_RO_PACKAGES}/org.tizen.aurum-bootstrap.xml
 %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap/*
 
+%if 0%{?gendoc:1}
 %files docs
 %manifest %{name}.manifest
 %defattr(-,root,root)
 %license COPYING
 %{_datadir}/doc/aurum/
+%endif
 
 %if 0%{?gcov:1}
 %files gcov
@@ -206,5 +219,4 @@ echo "signing %{TZ_SYS_RO_APP}/org.tizen.aurum-bootstrap"
 %{_bindir}/gtest_aurum
 %else
 %exclude %{_bindir}/gtest_aurum
-%endif
-
+%endif
\ No newline at end of file