do not require python by default

This commit is contained in:
Radovan Bast 2015-06-20 15:49:13 +02:00
parent 0c5690a34a
commit 39d8b029db
2 changed files with 7 additions and 15 deletions

View File

@ -3,6 +3,8 @@
# Generates source code that echoes configuration and build
# information to the program output.
find_package(PythonInterp REQUIRED)
# generated cmake files will be written to this path
# only build info is generated
# everything else is static for the user

View File

@ -159,30 +159,20 @@ def gen_cmakelists(config, relative_path, list_of_modules):
s.append('# set minimum cmake version')
s.append('cmake_minimum_required(VERSION 2.8 FATAL_ERROR)')
s.append('\n')
s.append('project(%s)' % project_name)
s.append('\nproject(%s)' % project_name)
s.append('\n')
s.append('# do not rebuild if rules (compiler flags) change')
s.append('\n# do not rebuild if rules (compiler flags) change')
s.append('set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)')
s.append('\n')
s.append('if(NOT CMAKE_BUILD_TYPE)')
s.append('\nif(NOT CMAKE_BUILD_TYPE)')
s.append(' set(CMAKE_BUILD_TYPE "Debug")')
s.append('endif()')
s.append('\n')
s.append('# python interpreter is required at many')
s.append('# places during configuration and build')
s.append('find_package(PythonInterp REQUIRED)')
s.append('\n')
s.append('# directory which holds enabled cmake modules')
s.append('\n# directory which holds enabled cmake modules')
s.append('set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}')
s.append(' ${PROJECT_SOURCE_DIR}/%s)' % os.path.join(relative_path, 'modules'))
s.append('\n')
s.append('# included cmake modules')
s.append('\n# included cmake modules')
for m in list_of_modules:
s.append('include(autocmake_%s)' % os.path.splitext(m)[0])