Skip to content

Commit 1d62d3f

Browse files
committed
minor update in cmake infrastructure
1 parent af8eeac commit 1d62d3f

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

cmake/autocmake/generate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def gen_setup(config, default_build_type, relative_path, setup_script_name):
5656
s.append('\n{0}'.format(autogenerated_notice()))
5757
s.append('\nimport os')
5858
s.append('import sys')
59-
s.append('assert sys.version_info >= (2, 6), \'Python >= 2.6 is required\' ')
59+
s.append('assert sys.version_info >= (2, 6), \'Python >= 2.6 is required\'')
6060

6161
s.append("\nsys.path.insert(0, '{0}')".format(relative_path))
6262

cmake/update.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ def process_yaml(argv):
144144
if 'language' in config:
145145
project_language = ' '.join(config['language']) if isinstance(config['language'], list) else config['language']
146146
else:
147-
sys.stderr.write("ERROR: you have to specify the project language(s) in autocmake.yml\n")
147+
sys.stderr.write("ERROR: you have to specify the project language(s) in autocmake.yml\n\n")
148+
sys.stderr.write("# for instance like this (several languages):\nlanguage:\n - CXX\n - Fortran\n\n")
149+
sys.stderr.write("# or like this (one language):\nlanguage: Fortran\n\n")
148150
sys.exit(-1)
149151

150152
if 'min_cmake_version' in config:
@@ -156,7 +158,8 @@ def process_yaml(argv):
156158
if 'default_build_type' in config:
157159
default_build_type = config['default_build_type'].lower()
158160
else:
159-
sys.stderr.write("ERROR: you have to specify default_build_type in autocmake.yml\n")
161+
sys.stderr.write("ERROR: you have to specify default_build_type in autocmake.yml\n\n")
162+
sys.stderr.write("# for instance like this (debug, release, relwithdebinfo, or minsizerel):\ndefault_build_type: release\n\n")
160163
sys.exit(-1)
161164

162165
if 'setup_script' in config:
@@ -189,14 +192,15 @@ def process_yaml(argv):
189192
with open(os.path.join(project_root, 'CMakeLists.txt'), 'w') as f:
190193
f.write('{0}\n'.format('\n'.join(s)))
191194

192-
# create setup script
193-
print('- generating setup script')
194-
s = gen_setup(cleaned_config, default_build_type, relative_path, setup_script_name)
195-
file_path = os.path.join(project_root, setup_script_name)
196-
with open(file_path, 'w') as f:
197-
f.write('{0}\n'.format('\n'.join(s)))
198-
if sys.platform != 'win32':
199-
make_executable(file_path)
195+
# create setup script unless it is 'None' or 'none'
196+
if setup_script_name.lower() != 'none':
197+
print('- generating setup script')
198+
s = gen_setup(cleaned_config, default_build_type, relative_path, setup_script_name)
199+
file_path = os.path.join(project_root, setup_script_name)
200+
with open(file_path, 'w') as f:
201+
f.write('{0}\n'.format('\n'.join(s)))
202+
if sys.platform != 'win32':
203+
make_executable(file_path)
200204

201205

202206
def main(argv):

setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import os
77
import sys
8-
assert sys.version_info >= (2, 6), 'Python >= 2.6 is required'
8+
assert sys.version_info >= (2, 6), 'Python >= 2.6 is required'
99

1010
sys.path.insert(0, 'cmake')
1111
from autocmake import configure

0 commit comments

Comments
 (0)