From 5b2fba5d402246bebc6d89573fbc4bb6192ccf8b Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 10 Dec 2012 17:02:46 -0500 Subject: [PATCH] ExternalProject: Simplify CMake command line generation Append the source directory to the command line option in a separate step instead of duplicating it with each possible generator. --- Modules/ExternalProject.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 2355dac47..1ef20d330 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1586,15 +1586,16 @@ function(_ep_add_configure_command name) get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) if(cmake_generator) - list(APPEND cmd "-G${cmake_generator}" "${source_dir}") + list(APPEND cmd "-G${cmake_generator}") else() if(CMAKE_EXTRA_GENERATOR) - list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}" - "${source_dir}") + list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}") else() - list(APPEND cmd "-G${CMAKE_GENERATOR}" "${source_dir}") + list(APPEND cmd "-G${CMAKE_GENERATOR}") endif() endif() + + list(APPEND cmd "${source_dir}") endif() # If anything about the configure command changes, (command itself, cmake