diff options
Diffstat (limited to 'cmake/scripts')
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake index 0525f1b47e..3898aa1ab7 100644 --- a/cmake/scripts/common/ModuleHelpers.cmake +++ b/cmake/scripts/common/ModuleHelpers.cmake @@ -216,6 +216,21 @@ macro(BUILD_DEP_TARGET) endif() endif() endif() + + # Xcode - Default sub projects to makefile builds. More consistent + # Windows - Default to same generator version used in parent + if(CMAKE_GENERATOR STREQUAL Xcode) + if(NOT ${MODULE}_GENERATOR) + set(${MODULE}_GENERATOR CMAKE_GENERATOR "Unix Makefiles") + endif() + elseif(MSVC) + if(NOT ${MODULE}_GENERATOR) + set(${MODULE}_GENERATOR CMAKE_GENERATOR "${CMAKE_GENERATOR}") + endif() + if(NOT ${MODULE}_GENERATOR_PLATFORM) + set(${MODULE}_GENERATOR_PLATFORM CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}) + endif() + endif() endif() if(PATCH_COMMAND) |