diff options
author | Brad King <brad.king@kitware.com> | 2009-03-30 15:38:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-30 15:38:05 (GMT) |
commit | f3ba510a651891997dff536041d9183a52cd4fe5 (patch) | |
tree | 0b0d24a6fd2b0dfe0d5ea96d02b9e5b68be77496 /Modules | |
parent | 385eb4dea7849b0d300d642dfcb5c11016642fcd (diff) | |
download | CMake-f3ba510a651891997dff536041d9183a52cd4fe5.zip CMake-f3ba510a651891997dff536041d9183a52cd4fe5.tar.gz CMake-f3ba510a651891997dff536041d9183a52cd4fe5.tar.bz2 |
ENH: Simpler AddExternalProject configure step
This simplifies the implementation with add_external_project_step.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/AddExternalProject.cmake | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/Modules/AddExternalProject.cmake b/Modules/AddExternalProject.cmake index 2cd4b30..82fd5b0 100644 --- a/Modules/AddExternalProject.cmake +++ b/Modules/AddExternalProject.cmake @@ -466,55 +466,38 @@ function(add_external_project_configure_command name) # Create the working_dir for configure, build and install steps: # mkdir("${working_dir}") - add_custom_command( - OUTPUT ${sentinels_dir}/${name}-working_dir + add_external_project_step(${name} working_dir + COMMENT "Making directory \"${working_dir}\"" COMMAND ${CMAKE_COMMAND} -E make_directory ${working_dir} - COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-working_dir - DEPENDS ${sentinels_dir}/${name}-update - ${sentinels_dir}/${name}-patch - ${file_deps} - VERBATIM + DEPENDEES update patch + DEPENDS ${file_deps} ) - get_target_property(cmd ${name} AEP_CONFIGURE_COMMAND) - if(cmd STREQUAL "") - # Explicit empty string means no configure step for this project - add_custom_command( - OUTPUT ${sentinels_dir}/${name}-configure - COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-configure - WORKING_DIRECTORY ${working_dir} - COMMENT "No configure step for '${name}'" - DEPENDS ${sentinels_dir}/${name}-working_dir - VERBATIM - ) + get_property(cmd_set TARGET ${name} PROPERTY AEP_CONFIGURE_COMMAND SET) + if(cmd_set) + get_property(cmd TARGET ${name} PROPERTY AEP_CONFIGURE_COMMAND) else() - if(NOT cmd) - get_target_property(cmake_command ${name} AEP_CMAKE_COMMAND) - if(cmake_command) - set(cmd "${cmake_command}") - else() - set(cmd "${CMAKE_COMMAND}") - endif() + get_target_property(cmake_command ${name} AEP_CMAKE_COMMAND) + if(cmake_command) + set(cmd "${cmake_command}") + else() + set(cmd "${CMAKE_COMMAND}") + endif() - get_property(cmake_args TARGET ${name} PROPERTY AEP_CMAKE_ARGS) - list(APPEND cmd ${cmake_args}) + get_property(cmake_args TARGET ${name} PROPERTY AEP_CMAKE_ARGS) + list(APPEND cmd ${cmake_args}) - get_target_property(cmake_generator ${name} AEP_CMAKE_GENERATOR) - if(cmake_generator) - list(APPEND cmd "-G${cmake_generator}" "${source_dir}/${name}") - endif() + get_target_property(cmake_generator ${name} AEP_CMAKE_GENERATOR) + if(cmake_generator) + list(APPEND cmd "-G${cmake_generator}" "${source_dir}/${name}") endif() - - add_custom_command( - OUTPUT ${sentinels_dir}/${name}-configure - COMMAND ${cmd} - COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-configure - WORKING_DIRECTORY ${working_dir} - COMMENT "Performing configure step for '${name}'" - DEPENDS ${sentinels_dir}/${name}-working_dir - VERBATIM - ) endif() + + add_external_project_step(${name} configure + COMMAND ${cmd} + WORKING_DIRECTORY ${working_dir} + DEPENDEES working_dir + ) endfunction(add_external_project_configure_command) |