diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 5 | ||||
-rw-r--r-- | Modules/CompilerId/Xcode-3.pbxproj.in | 1 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 20 |
3 files changed, 22 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 609f35b..b918092 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -177,6 +177,11 @@ Id flags: ${testflags} set(id_type ${CMAKE_${lang}_COMPILER_XCODE_TYPE}) set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR}) get_filename_component(id_src "${src}" NAME) + if(CMAKE_XCODE_PLATFORM_TOOLSET) + set(id_toolset "GCC_VERSION = ${CMAKE_XCODE_PLATFORM_TOOLSET};") + else() + set(id_toolset "") + endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index 41ca7db..d94a803 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -83,6 +83,7 @@ ONLY_ACTIVE_ARCH = YES; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; + @id_toolset@ }; name = Debug; }; diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index ed7fd7c..bf2892b 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -38,6 +38,7 @@ # [CONFIGURE_COMMAND cmd...] # Build tree configuration command # [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable # [CMAKE_GENERATOR gen] # Specify generator for native build +# [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name # [CMAKE_ARGS args...] # Arguments to CMake command line # [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on # #--Build step----------------- @@ -1588,16 +1589,27 @@ function(_ep_add_configure_command name) endif() get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) + get_target_property(cmake_generator_toolset ${name} _EP_CMAKE_GENERATOR_TOOLSET) if(cmake_generator) - list(APPEND cmd "-G${cmake_generator}" "${source_dir}") + list(APPEND cmd "-G${cmake_generator}") + if(cmake_generator_toolset) + list(APPEND cmd "-T${cmake_generator_toolset}") + endif() 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() + if(cmake_generator_toolset) + message(FATAL_ERROR "Option CMAKE_GENERATOR_TOOLSET not allowed without CMAKE_GENERATOR.") + endif() + if(CMAKE_GENERATOR_TOOLSET) + list(APPEND cmd "-T${CMAKE_GENERATOR_TOOLSET}") endif() endif() + + list(APPEND cmd "${source_dir}") endif() # If anything about the configure command changes, (command itself, cmake |