cmake: use Win32Deps when mingw cross compiling

So that dependencies submodule is cloned.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-04-16 13:07:51 +00:00
parent ffc9309253
commit 8abbb070e8
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,7 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0077 NEW) # use vars for options
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW) # for wxWidgets, use generator expressions
endif()
endif()

View File

@ -1,4 +1,4 @@
if(WIN32)
if(WIN32 OR CMAKE_TOOLCHAIN_FILE MATCHES "[Mm][Ii][Nn][Gg][Ww]")
# compiler has not been detected yet maybe
if(CMAKE_C_COMPILER MATCHES "cl\\.exe" OR CMAKE_CXX_COMPILER MATCHES "cl\\.exe" OR MSVC OR DEFINED ENV{VisualStudioVersion})
set(VS TRUE)
@ -12,11 +12,14 @@ if(WIN32)
# Win32 deps submodules (dependencies and vcpkg)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include" OR NOT EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(git_checkout FALSE)
# find_package(Git)
#if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(git_checkout TRUE)
execute_process(COMMAND git submodule update --init --remote --recursive RESULT_VARIABLE git_status WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
execute_process(
COMMAND git submodule update --init --remote --recursive
RESULT_VARIABLE git_status
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
endif()
if(NOT (git_checkout AND git_status EQUAL 0))