From f20799e3e2081ac6618fc43969010e8986f6a4be Mon Sep 17 00:00:00 2001 From: Miro ILIAS Date: Sun, 28 Jun 2015 22:14:12 +0200 Subject: [PATCH 1/3] inserted function for preprocesing cmake_command for MS Windows,testing phase --- lib/config.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/config.py b/lib/config.py index a2e416b..495dfd4 100644 --- a/lib/config.py +++ b/lib/config.py @@ -43,6 +43,38 @@ def setup_build_path(build_path): else: os.makedirs(build_path, 0o755) +def adapt_cmake_command_to_arch(cmake_command): + """ + Adapt CMake command for MS Windows architecture: + + "FC=foo CC=bar cmake -DTHIS -DTHAT='this and that'" rewrites into + + "set FC=foo && set CC=bar && cmake -DTHIS -DTHAT='this and that'" + """ + + if sys.platform == 'win32': + cmake_pos=cmake_command.find('cmake') + cmake_export_vars=cmake_command[:cmake_pos] + cmake_strings=cmake_command[cmake_pos:] + print "\n strings from cmake to right:",cmake_strings + print "strings from left up to cmake:",cmake_export_vars + print "strings from left up to cmake, split:",cmake_export_vars.split() + all_modified_exported_vars="" + for exported_var in cmake_export_vars.split(): + print "exported_var=",exported_var + modified_exported_var="set " + exported_var + " && " + all_modified_exported_vars=all_modified_exported_vars+modified_exported_var + print "all_modified_exported_vars=",all_modified_exported_vars + cmake_command_win=all_modified_exported_vars+cmake_strings + print "cmake_command_win=",cmake_command_win + print "\n" + #sys.exit(-1) + cmake_command_arch = cmake_command_win + else: + cmake_command_arch = cmake_command + + return cmake_command_arch + def run_cmake(command, build_path, default_build_path): """ @@ -115,6 +147,8 @@ def configure(root_directory, build_path, cmake_command, only_show): if not only_show: setup_build_path(build_path) + cmake_command=adapt_cmake_command_to_arch(cmake_command) + print('%s\n' % cmake_command) if only_show: sys.exit(0) From a2924b9f69134011a4efdcbe9bd9477c9be244fd Mon Sep 17 00:00:00 2001 From: Miro ILIAS Date: Sun, 28 Jun 2015 22:18:55 +0200 Subject: [PATCH 2/3] cmake_command preprocessing function adapted/polished for MS Window --- lib/config.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/config.py b/lib/config.py index 495dfd4..8308621 100644 --- a/lib/config.py +++ b/lib/config.py @@ -47,29 +47,20 @@ def adapt_cmake_command_to_arch(cmake_command): """ Adapt CMake command for MS Windows architecture: - "FC=foo CC=bar cmake -DTHIS -DTHAT='this and that'" rewrites into + "FC=foo CC=bar cmake -DTHIS -DTHAT='this and that'" rewrites into - "set FC=foo && set CC=bar && cmake -DTHIS -DTHAT='this and that'" + "set FC=foo && set CC=bar && cmake -DTHIS -DTHAT='this and that'" """ if sys.platform == 'win32': cmake_pos=cmake_command.find('cmake') cmake_export_vars=cmake_command[:cmake_pos] cmake_strings=cmake_command[cmake_pos:] - print "\n strings from cmake to right:",cmake_strings - print "strings from left up to cmake:",cmake_export_vars - print "strings from left up to cmake, split:",cmake_export_vars.split() all_modified_exported_vars="" for exported_var in cmake_export_vars.split(): - print "exported_var=",exported_var modified_exported_var="set " + exported_var + " && " all_modified_exported_vars=all_modified_exported_vars+modified_exported_var - print "all_modified_exported_vars=",all_modified_exported_vars - cmake_command_win=all_modified_exported_vars+cmake_strings - print "cmake_command_win=",cmake_command_win - print "\n" - #sys.exit(-1) - cmake_command_arch = cmake_command_win + cmake_command_arch = all_modified_exported_vars + cmake_strings else: cmake_command_arch = cmake_command From 196470a0ff60631d32536cdc7e26e1c0bd565262 Mon Sep 17 00:00:00 2001 From: Miro ILIAS Date: Sun, 28 Jun 2015 22:26:07 +0200 Subject: [PATCH 3/3] added badge for appveyor-CI using scisoft/autocmake branch appveyor --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 5dc7f3b..29c3540 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ [![Build Status](https://travis-ci.org/scisoft/autocmake.svg?branch=master)](https://travis-ci.org/scisoft/autocmake/builds) [![Documentation Status](https://readthedocs.org/projects/autocmake/badge/?version=latest)](http://autocmake.readthedocs.org) - -MiroI build statuses: -[![Build Status](https://travis-ci.org/miroi/autocmake.svg?branch=master)](https://travis-ci.org/miroi/autocmake/builds) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/miroi/autocmake?branch=master&svg=true)](https://ci.appveyor.com/project/miroi/autocmake) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/scisoft/autocmake?branch=appveyor&svg=true)](https://ci.appveyor.com/project/scisoft/autocmake) # Autocmake