Skip to content

Commit

Permalink
Say hello to CMake files and mingw32/64 toolchains
Browse files Browse the repository at this point in the history
MinGW toolchanins are uesfull to cross-compile Allegiance for Windows from Linux.
  • Loading branch information
bog-dan-ro committed Nov 4, 2017
1 parent 7cddd79 commit f0571e8
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.1)

PROJECT(Allegiance)

ADD_SUBDIRECTORY(src)
12 changes: 12 additions & 0 deletions cmake/toolchain-mingw32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)

set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
12 changes: 12 additions & 0 deletions cmake/toolchain-mingw64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ADD_SUBDIRECTORY(zlib)
#ADD_SUBDIRECTORY(soundengine)
#ADD_SUBDIRECTORY(engine)
#ADD_SUBDIRECTORY(effect)
#ADD_SUBDIRECTORY(_Utility)
#ADD_SUBDIRECTORY(Igc)
#ADD_SUBDIRECTORY(training)
#ADD_SUBDIRECTORY(clintlib)
#ADD_SUBDIRECTORY(WinTrek)

0 comments on commit f0571e8

Please sign in to comment.