Created
September 22, 2020 09:15
-
-
Save mbilyanov/0c8f25653a6015bdc8f904bcaea3bff5 to your computer and use it in GitHub Desktop.
toolchain-mingw32.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the name of the target operating system | |
SET(CMAKE_SYSTEM_NAME Windows) | |
# Choose an appropriate compiler prefix | |
# /include and /lib folders required by the 64bit mingw. | |
set(COMPILER_PREFIX "x86_64-w64-mingw32") | |
# which compilers to use for C and C++ | |
find_program(CMAKE_C_COMPILER NAMES /usr/bin/${COMPILER_PREFIX}-gcc) | |
find_program(CMAKE_CXX_COMPILER NAMES /usr/bin/${COMPILER_PREFIX}-g++) | |
# here is the target environment located | |
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX}) | |
# adjust the default behaviour of the FIND_XXX() commands: | |
# search headers and libraries in the target environment, search | |
# programs in the host environment | |
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment