Mercurial > hg > orthanc
changeset 514:a3d9acf37161 laaw
build script
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 18 Jul 2013 12:45:40 +0200 |
parents | 1b8a1c43893e |
children | 49a1228d6fe7 |
files | OrthancCppClient/Package/OrthancCppClient.cmake OrthancCppClient/Package/Test/Basic/Build.sh Resources/MinGW64Toolchain.cmake |
diffstat | 3 files changed, 50 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancCppClient/Package/OrthancCppClient.cmake Thu Jul 18 12:36:02 2013 +0200 +++ b/OrthancCppClient/Package/OrthancCppClient.cmake Thu Jul 18 12:45:40 2013 +0200 @@ -1,5 +1,3 @@ -# nm -C -D --defined-only libOrthancCppClient.so - include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw) set(STATIC_BUILD ON)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OrthancCppClient/Package/Test/Basic/Build.sh Thu Jul 18 12:45:40 2013 +0200 @@ -0,0 +1,16 @@ +#!/bin/bash + +rm -rf i w32 w64 +mkdir i +mkdir w32 +mkdir w64 + +cd i && cmake .. && cd .. && \ + cd w32 && cmake .. -DCMAKE_TOOLCHAIN_FILE=../../../../Resources/MinGWToolchain.cmake && cd .. && \ + cd w64 && cmake .. -DCMAKE_TOOLCHAIN_FILE=../../../../Resources/MinGW64Toolchain.cmake && cd .. + +make -C i -j12 +make -C w32 -j12 +make -C w64 -j12 + +nm -C -D --defined-only i/libOrthancCppClient.so
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/MinGW64Toolchain.cmake Thu Jul 18 12:45:40 2013 +0200 @@ -0,0 +1,34 @@ +# http://sourceforge.net/apps/trac/mingw-w64/wiki/GeneralUsageInstructions + +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +# Detect the prefix of the mingw-w64 compiler +execute_process( + COMMAND uname -p + OUTPUT_VARIABLE MINGW64_ARCHITECTURE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + +if (${MINGW64_ARCHITECTURE} STREQUAL "x86_64") + set(MINGW64_PREFIX "x86_64") +else() + set(MINGW64_PREFIX "i686") +endif() + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER ${MINGW64_PREFIX}-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER ${MINGW64_PREFIX}-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER ${MINGW64_PREFIX}-w64-mingw32-windres) + +# 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_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} <SOURCE> <OBJECT>")