summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-30 15:38:26 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-30 15:38:26 (GMT)
commitbf09570615d159f81cc68a3ea50b4dcc9263398f (patch)
treeee90adbb662c641b6c1557a84d4d2c0a749e0e2c /Modules
parentf3ba510a651891997dff536041d9183a52cd4fe5 (diff)
downloadCMake-bf09570615d159f81cc68a3ea50b4dcc9263398f.zip
CMake-bf09570615d159f81cc68a3ea50b4dcc9263398f.tar.gz
CMake-bf09570615d159f81cc68a3ea50b4dcc9263398f.tar.bz2
ENH: Simpler AddExternalProject build step
This simplifies the implementation with add_external_project_step.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AddExternalProject.cmake29
1 files changed, 8 insertions, 21 deletions
diff --git a/Modules/AddExternalProject.cmake b/Modules/AddExternalProject.cmake
index 82fd5b0..9702b66 100644
--- a/Modules/AddExternalProject.cmake
+++ b/Modules/AddExternalProject.cmake
@@ -506,30 +506,17 @@ function(add_external_project_build_command name)
sentinels_dir source_dir tmp_dir)
get_configure_build_working_dir(${name} working_dir)
- get_target_property(cmd ${name} AEP_BUILD_COMMAND)
- if(cmd STREQUAL "")
- # Explicit empty string means no build step for this project
- add_custom_command(
- OUTPUT ${sentinels_dir}/${name}-build
- COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-build
- WORKING_DIRECTORY ${working_dir}
- COMMENT "No build step for '${name}'"
- DEPENDS ${sentinels_dir}/${name}-configure
- VERBATIM
- )
+ get_property(cmd_set TARGET ${name} PROPERTY AEP_BUILD_COMMAND SET)
+ if(cmd_set)
+ get_property(cmd TARGET ${name} PROPERTY AEP_BUILD_COMMAND)
else()
_aep_get_build_command(${name} BUILD cmd)
-
- add_custom_command(
- OUTPUT ${sentinels_dir}/${name}-build
- COMMAND ${cmd}
- COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-build
- WORKING_DIRECTORY ${working_dir}
- COMMENT "Performing build step for '${name}'"
- DEPENDS ${sentinels_dir}/${name}-configure
- VERBATIM
- )
endif()
+ add_external_project_step(${name} build
+ COMMAND ${cmd}
+ WORKING_DIRECTORY ${working_dir}
+ DEPENDEES configure
+ )
endfunction(add_external_project_build_command)