summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python/modtool')
-rw-r--r--gr-utils/python/modtool/gr-newmod/CMakeLists.txt15
-rw-r--r--gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt16
-rw-r--r--gr-utils/python/modtool/modtool_add.py14
-rw-r--r--gr-utils/python/modtool/templates.py2
4 files changed, 35 insertions, 12 deletions
diff --git a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
index 9b41b99f14..bde9dc0c0f 100644
--- a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
+++ b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2011,2012,2014 Free Software Foundation, Inc.
+# Copyright 2011,2012,2014,2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -24,6 +24,12 @@ cmake_minimum_required(VERSION 2.6)
project(gr-howto CXX C)
enable_testing()
+#install to PyBOMBS target prefix if defined
+if(DEFINED ENV{PYBOMBS_PREFIX})
+ set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX})
+ message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}")
+endif()
+
#select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@@ -34,6 +40,12 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
#make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+# Set the version information here
+set(VERSION_INFO_MAJOR_VERSION 1)
+set(VERSION_INFO_API_COMPAT 0)
+set(VERSION_INFO_MINOR_VERSION 0)
+set(VERSION_INFO_MAINT_VERSION git)
+
########################################################################
# Compiler specific setup
########################################################################
@@ -113,6 +125,7 @@ find_package(Doxygen)
set(GR_REQUIRED_COMPONENTS RUNTIME)
find_package(Gnuradio "3.7.2" REQUIRED)
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+include(GrVersion)
if(NOT CPPUNIT_FOUND)
message(FATAL_ERROR "CppUnit required to compile howto")
diff --git a/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt b/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt
index 6192c51f04..10a15b7dd9 100644
--- a/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt
+++ b/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2011,2012 Free Software Foundation, Inc.
+# Copyright 2011,2012,2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -47,11 +47,8 @@ endif(APPLE)
########################################################################
# Install built library files
########################################################################
-install(TARGETS gnuradio-howto
- LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
- ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
- RUNTIME DESTINATION bin # .dll file
-)
+include(GrMiscUtils)
+GR_LIBRARY_FOO(gnuradio-howto RUNTIME_COMPONENT "howto_runtime" DEVEL_COMPONENT "howto_devel")
########################################################################
# Build and register unit test
@@ -76,3 +73,10 @@ target_link_libraries(
)
GR_ADD_TEST(test_howto test-howto)
+
+########################################################################
+# Print summary
+########################################################################
+message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
+message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
+
diff --git a/gr-utils/python/modtool/modtool_add.py b/gr-utils/python/modtool/modtool_add.py
index 77f82aaae9..b60474740c 100644
--- a/gr-utils/python/modtool/modtool_add.py
+++ b/gr-utils/python/modtool/modtool_add.py
@@ -53,6 +53,8 @@ class ModToolAdd(ModTool):
choices=self._block_types, default=None, help="One of %s." % ', '.join(self._block_types))
ogroup.add_option("--license-file", type="string", default=None,
help="File containing the license header for every source code file.")
+ ogroup.add_option("--copyright", type="string", default=None,
+ help="Name of the copyright holder (you or your company) MUST be a quoted string.")
ogroup.add_option("--argument-list", type="string", default=None,
help="The argument list for the constructor and make functions.")
ogroup.add_option("--add-python-qa", action="store_true", default=None,
@@ -77,7 +79,6 @@ class ModToolAdd(ModTool):
self._info['blocktype'] = raw_input("Enter block type: ")
if self._info['blocktype'] not in self._block_types:
print 'Must be one of ' + str(self._block_types)
-
# Allow user to specify language interactively if not set
self._info['lang'] = options.lang
if self._info['lang'] is None:
@@ -101,8 +102,14 @@ class ModToolAdd(ModTool):
raise ModToolException('Invalid block name.')
print "Block/code identifier: " + self._info['blockname']
self._info['fullblockname'] = self._info['modname'] + '_' + self._info['blockname']
+ if not options.license_file:
+ self._info['copyrightholder'] = options.copyright
+ if self._info['copyrightholder'] is None:
+ self._info['copyrightholder'] = '<+YOU OR YOUR COMPANY+>'
+ elif self._info['is_component']:
+ print "For GNU Radio components the FSF is added as copyright holder"
+ self._license_file = options.license_file
self._info['license'] = self.setup_choose_license()
-
if options.argument_list is not None:
self._info['arglist'] = options.argument_list
else:
@@ -121,7 +128,6 @@ class ModToolAdd(ModTool):
print "Warning: Autotools modules are not supported. ",
print "Files will be created, but Makefiles will not be edited."
self._skip_cmakefiles = True
- self._license_file = options.license_file
def setup_choose_license(self):
""" Select a license by the following rules, in this order:
@@ -139,7 +145,7 @@ class ModToolAdd(ModTool):
elif self._info['is_component']:
return Templates['grlicense']
else:
- return Templates['defaultlicense']
+ return get_template('defaultlicense', **self._info)
def _write_tpl(self, tpl, path, fname):
""" Shorthand for writing a substituted template to a file"""
diff --git a/gr-utils/python/modtool/templates.py b/gr-utils/python/modtool/templates.py
index dc840df392..9caf658194 100644
--- a/gr-utils/python/modtool/templates.py
+++ b/gr-utils/python/modtool/templates.py
@@ -26,7 +26,7 @@ Templates = {}
# Default licence
Templates['defaultlicense'] = '''
-Copyright %d <+YOU OR YOUR COMPANY+>.
+Copyright %d ${copyrightholder}.
This is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by