Skip to content

Commit

Permalink
bugfix init_build.
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Mar 29, 2013
1 parent f2d401f commit ab7ebf8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2.3
- bugfix for missing arg in yujin_init_build's config.cmake dump.
0.2.2
- install target for yujin_make
- symlink'd source space into build space to remove shared toplevel.cmake dependancy
0.2.1
- add tests and run_tests options
0.2.0
Expand Down
2 changes: 1 addition & 1 deletion src/yujin_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

__version__ = '0.2.1'
__version__ = '0.2.3'

from .init_workspace import init_workspace
from .init_build import init_build
Expand Down
41 changes: 22 additions & 19 deletions src/yujin_tools/init_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def is_exe(fpath):
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file

return None


Expand Down Expand Up @@ -96,9 +95,12 @@ def fill_in_config_cmake(template, config_build_type, config_install_prefix, con
return template % locals()


def instantiate_config_cmake(build_path, config_build_type, config_install_prefix, config_underlays):
def instantiate_config_cmake(platform_content, build_path, config_build_type, config_install_prefix, config_underlays):
'''
Copy the cache configuration template to the build path.
@param platform_content : content to prepend to the default configuration file
@param build_path : location of the build directory to save the config.cmake file.
'''
template_dir = os.path.join(os.path.dirname(__file__), 'cmake')
template = read_template(os.path.join(template_dir, "config.cmake"))
Expand Down Expand Up @@ -236,22 +238,6 @@ def init_configured_build(build_dir_="./", source_dir_="./src", underlays_="/opt
common.create_symlink(catkin_toplevel, os.path.join(build_source_dir, "CMakeLists.txt"))
underlays = ';'.join(underlays_list)

##########################
# Toolchain
##########################
if not toolchain_ == "":
toolchains_dir = os.path.join(os.path.dirname(__file__), 'toolchains')
if os.path.isfile(os.path.join(toolchains_dir, toolchain_ + ".cmake")):
shutil.copy(os.path.join(toolchains_dir, toolchain_ + ".cmake"), os.path.join(build_dir, "toolchain.cmake"))

##########################
# Platform
##########################
if not platform_ == "":
platforms_dir = os.path.join(os.path.dirname(__file__), 'platforms')
if os.path.isfile(os.path.join(platforms_dir, platform_ + ".cmake")):
shutil.copy(os.path.join(platforms_dir, platform_ + ".cmake"), os.path.join(build_dir, "platform.cmake"))

##########################
# Other Args
##########################
Expand All @@ -268,10 +254,27 @@ def init_configured_build(build_dir_="./", source_dir_="./src", underlays_="/opt
print_build_details(build_dir, source_dir, install_prefix, build_type, underlays, name, toolchain_, platform_)
os.chdir(build_dir)

##########################
# Toolchain
##########################
if not toolchain_ == "":
toolchains_dir = os.path.join(os.path.dirname(__file__), 'toolchains')
if os.path.isfile(os.path.join(toolchains_dir, toolchain_ + ".cmake")):
shutil.copy(os.path.join(toolchains_dir, toolchain_ + ".cmake"), os.path.join(build_dir, "toolchain.cmake"))

##########################
# Platform
##########################
platform_content = ""
if not platform_ == "":
platforms_dir = os.path.join(os.path.dirname(__file__), 'platforms')
if os.path.isfile(os.path.join(platforms_dir, platform_ + ".cmake")):
shutil.copy(os.path.join(platforms_dir, platform_ + ".cmake"), os.path.join(build_dir, "platform.cmake"))

##########################
# Cache
##########################
instantiate_config_cmake(build_dir, build_type, install_prefix, underlays)
instantiate_config_cmake(platform_content, build_dir, build_type, install_prefix, underlays)

##########################
# Templates
Expand Down

0 comments on commit ab7ebf8

Please sign in to comment.