diff options
author | Brad King <brad.king@kitware.com> | 2019-04-15 14:52:11 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-04-15 10:52:21 -0400 |
commit | 0793464d95c3dbbe9ed87bb5882d29efb7a8e3c3 (patch) | |
tree | 54458011255823399eed7a0b76f5db980e8a4aa3 /Modules/ExternalProject.cmake | |
parent | e2128e11ac7ac38f33100f5277cb4ace8697bad8 (diff) | |
parent | 2bae6a1346cb95703a93dbf73c9689598c9056d1 (diff) | |
download | cmake-0793464d95c3dbbe9ed87bb5882d29efb7a8e3c3.tar.gz |
Merge topic 'ghs_custom'
2bae6a1346 GHS: Update tests and notes
3b415c60c1 GHS: Update ExternalProject for GHS tools
83c47ef5b8 GHS: Update project layout to accommodate gbuild inconsistencies
5d2e1404bd GHS: Update project layout to build targets correctly
b6bfa7eeb2 GHS: Support add_dependencies() command
39ee9718d9 GHS: Support add_custom_target() command
8d3dad9a76 GHS: Support add_custom_command( OUTPUT ) signature
37acc9e229 GHS: Update custom command build events
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Narendhar Manimohan <narendhar15@gmail.com>
Merge-request: !3119
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r-- | Modules/ExternalProject.cmake | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 8f1e194857..20b37d222f 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -422,6 +422,10 @@ External Project Definition different behavior depending on whether the build starts from a fresh build directory or re-uses previous build contents. + If the CMake generator is the ``Green Hills MULTI`` and not overridden then + the orginal projects settings for the GHS toolset and target system + customization cache variables are propagated into the external project. + ``SOURCE_SUBDIR <dir>`` When no ``CONFIGURE_COMMAND`` option is specified, the configure step assumes the external project has a ``CMakeLists.txt`` file at the top of @@ -2850,18 +2854,6 @@ function(_ep_extract_configure_command var name) set(has_cmake_cache_default_args 1) endif() - if(has_cmake_cache_args OR has_cmake_cache_default_args) - set(_ep_cache_args_script "<TMP_DIR>/${name}-cache-$<CONFIG>.cmake") - if(has_cmake_cache_args) - _ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1) - endif() - if(has_cmake_cache_default_args) - _ep_command_line_to_initial_cache(script_initial_cache_default "${cmake_cache_default_args}" 0) - endif() - _ep_write_initial_cache(${name} "${_ep_cache_args_script}" "${script_initial_cache_force}${script_initial_cache_default}") - list(APPEND cmd "-C${_ep_cache_args_script}") - endif() - get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) get_target_property(cmake_generator_instance ${name} _EP_CMAKE_GENERATOR_INSTANCE) get_target_property(cmake_generator_platform ${name} _EP_CMAKE_GENERATOR_PLATFORM) @@ -2882,6 +2874,16 @@ function(_ep_extract_configure_command var name) list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}") else() list(APPEND cmd "-G${CMAKE_GENERATOR}") + if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") + set(has_cmake_cache_default_args 1) + set(cmake_cache_default_args ${cmake_cache_default_args} + "-DGHS_TARGET_PLATFORM:STRING=${GHS_TARGET_PLATFORM}" + "-DGHS_PRIMARY_TARGET:STRING=${GHS_PRIMARY_TARGET}" + "-DGHS_TOOLSET_ROOT:STRING=${GHS_TOOLSET_ROOT}" + "-DGHS_OS_ROOT:STRING=${GHS_OS_ROOT}" + "-DGHS_OS_DIR:STRING=${GHS_OS_DIR}" + "-DGHS_BSP_NAME:STRING=${GHS_BSP_NAME}") + endif() endif() if(cmake_generator_platform) message(FATAL_ERROR "Option CMAKE_GENERATOR_PLATFORM not allowed without CMAKE_GENERATOR.") @@ -2903,6 +2905,18 @@ function(_ep_extract_configure_command var name) endif() endif() + if(has_cmake_cache_args OR has_cmake_cache_default_args) + set(_ep_cache_args_script "<TMP_DIR>/${name}-cache-$<CONFIG>.cmake") + if(has_cmake_cache_args) + _ep_command_line_to_initial_cache(script_initial_cache_force "${cmake_cache_args}" 1) + endif() + if(has_cmake_cache_default_args) + _ep_command_line_to_initial_cache(script_initial_cache_default "${cmake_cache_default_args}" 0) + endif() + _ep_write_initial_cache(${name} "${_ep_cache_args_script}" "${script_initial_cache_force}${script_initial_cache_default}") + list(APPEND cmd "-C${_ep_cache_args_script}") + endif() + list(APPEND cmd "<SOURCE_DIR><SOURCE_SUBDIR>") endif() |