mirror of
https://github.com/LMMS/lmms.git
synced 2026-02-02 18:54:29 -05:00
LMMS failed to build with recent versions of CMake if CMAKE_RC_COMPILER was not set in MinGWCrossCompile.cmake. Furthermore PKG_CONFIG_FOUND manually needs to be set to TRUE.
42 lines
1.3 KiB
CMake
42 lines
1.3 KiB
CMake
# this one is important
|
|
SET(CMAKE_SYSTEM_NAME Windows)
|
|
#this one not so much
|
|
SET(CMAKE_SYSTEM_VERSION 1)
|
|
|
|
# where is the target environment
|
|
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
|
|
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX})
|
|
|
|
SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)
|
|
|
|
# specify the cross compiler
|
|
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
|
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++)
|
|
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
|
|
|
IF(WIN64)
|
|
# specify the cross compiler
|
|
SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-)
|
|
SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc)
|
|
SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++)
|
|
ENDIF()
|
|
|
|
# specify location of some tools
|
|
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
|
|
SET(WINDRES ${MINGW_TOOL_PREFIX}windres)
|
|
SET(PKG_CONFIG_EXECUTABLE ${MINGW_TOOL_PREFIX}pkg-config)
|
|
SET(PKG_CONFIG_FOUND TRUE)
|
|
|
|
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin)
|
|
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
|
|
|
|
# search for programs in the build host directories
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
# for libraries and headers in the target directories
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include)
|
|
LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin)
|
|
|