From 016ad174031f03588b526ba873c6e14343199dab Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 14 Aug 2013 20:23:08 +0200 Subject: [PATCH] Added mingw-w64 toolchain files --- CMakeLists.txt | 2 +- Toolchain-Crossbuild32.cmake | 4 ---- Toolchain-mingw32.cmake | 16 ---------------- UseLibFTDI1.cmake | 18 ------------------ cmake/Toolchain-Crossbuild32.cmake | 4 ++++ cmake/Toolchain-i686-w64-mingw32.cmake | 17 +++++++++++++++++ cmake/Toolchain-mingw32.cmake | 16 ++++++++++++++++ cmake/Toolchain-x86_64-w64-mingw32.cmake | 17 +++++++++++++++++ cmake/UseLibFTDI1.cmake | 18 ++++++++++++++++++ 9 files changed, 73 insertions(+), 39 deletions(-) delete mode 100644 Toolchain-Crossbuild32.cmake delete mode 100644 Toolchain-mingw32.cmake delete mode 100644 UseLibFTDI1.cmake create mode 100644 cmake/Toolchain-Crossbuild32.cmake create mode 100644 cmake/Toolchain-i686-w64-mingw32.cmake create mode 100644 cmake/Toolchain-mingw32.cmake create mode 100644 cmake/Toolchain-x86_64-w64-mingw32.cmake create mode 100644 cmake/UseLibFTDI1.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c7a6a5..1e74b7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,7 @@ if ( UNIX ) set ( LIBFTDI_USE_FILE ${CMAKE_INSTALL_PREFIX}/${LIBFTDI_CMAKE_CONFIG_DIR}/UseLibFTDI1.cmake ) configure_file ( LibFTDI1Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake @ONLY ) - install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake UseLibFTDI1.cmake + install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake cmake/UseLibFTDI1.cmake DESTINATION ${LIBFTDI_CMAKE_CONFIG_DIR} ) endif () diff --git a/Toolchain-Crossbuild32.cmake b/Toolchain-Crossbuild32.cmake deleted file mode 100644 index 3c80dd8..0000000 --- a/Toolchain-Crossbuild32.cmake +++ /dev/null @@ -1,4 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_C_COMPILER gcc -m32) -set(CMAKE_CXX_COMPILER g++ -m32) -set(CMAKE_FIND_ROOT_PATH /usr/lib) diff --git a/Toolchain-mingw32.cmake b/Toolchain-mingw32.cmake deleted file mode 100644 index bff3cba..0000000 --- a/Toolchain-mingw32.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# the name of the target operating system -SET(CMAKE_SYSTEM_NAME Windows) - -# which compilers to use for C and C++ -SET(CMAKE_C_COMPILER i386-mingw32msvc-gcc) -SET(CMAKE_CXX_COMPILER i386-mingw32msvc-g++) - -# here is the target environment located -SET(CMAKE_FIND_ROOT_PATH /opt/cross/i386-mingw32msvc ) - -# 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) diff --git a/UseLibFTDI1.cmake b/UseLibFTDI1.cmake deleted file mode 100644 index e7e43b0..0000000 --- a/UseLibFTDI1.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# -*- cmake -*- -# -# UseLibFTDI.cmake -# -# Copyright (C) 2013 Intra2net AG and the libftdi developers -# -# This file is part of LibFTDI. -# -# LibFTDI is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License -# version 2.1 as published by the Free Software Foundation; -# - - -add_definitions ( ${LIBFTDI_DEFINITIONS} ) -include_directories ( ${LIBFTDI_INCLUDE_DIRS} ) -link_directories ( ${LIBFTDI_LIBRARY_DIRS} ) - diff --git a/cmake/Toolchain-Crossbuild32.cmake b/cmake/Toolchain-Crossbuild32.cmake new file mode 100644 index 0000000..3c80dd8 --- /dev/null +++ b/cmake/Toolchain-Crossbuild32.cmake @@ -0,0 +1,4 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_C_COMPILER gcc -m32) +set(CMAKE_CXX_COMPILER g++ -m32) +set(CMAKE_FIND_ROOT_PATH /usr/lib) diff --git a/cmake/Toolchain-i686-w64-mingw32.cmake b/cmake/Toolchain-i686-w64-mingw32.cmake new file mode 100644 index 0000000..1eed0cf --- /dev/null +++ b/cmake/Toolchain-i686-w64-mingw32.cmake @@ -0,0 +1,17 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 ) + +# 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) +set (CMAKE_RC_COMPILER i686-w64-mingw32-windres) diff --git a/cmake/Toolchain-mingw32.cmake b/cmake/Toolchain-mingw32.cmake new file mode 100644 index 0000000..bff3cba --- /dev/null +++ b/cmake/Toolchain-mingw32.cmake @@ -0,0 +1,16 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER i386-mingw32msvc-gcc) +SET(CMAKE_CXX_COMPILER i386-mingw32msvc-g++) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /opt/cross/i386-mingw32msvc ) + +# 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) diff --git a/cmake/Toolchain-x86_64-w64-mingw32.cmake b/cmake/Toolchain-x86_64-w64-mingw32.cmake new file mode 100644 index 0000000..20a5b40 --- /dev/null +++ b/cmake/Toolchain-x86_64-w64-mingw32.cmake @@ -0,0 +1,17 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ) + +# 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) +set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) diff --git a/cmake/UseLibFTDI1.cmake b/cmake/UseLibFTDI1.cmake new file mode 100644 index 0000000..e7e43b0 --- /dev/null +++ b/cmake/UseLibFTDI1.cmake @@ -0,0 +1,18 @@ +# -*- cmake -*- +# +# UseLibFTDI.cmake +# +# Copyright (C) 2013 Intra2net AG and the libftdi developers +# +# This file is part of LibFTDI. +# +# LibFTDI is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License +# version 2.1 as published by the Free Software Foundation; +# + + +add_definitions ( ${LIBFTDI_DEFINITIONS} ) +include_directories ( ${LIBFTDI_INCLUDE_DIRS} ) +link_directories ( ${LIBFTDI_LIBRARY_DIRS} ) + -- 1.7.1