1 # Copyright (C) 2017 Modelon AB
\r
3 # This program is free software: you can redistribute it and/or modify
\r
4 # it under the terms of the BSD style license.
\r
6 # This program is distributed in the hope that it will be useful,
\r
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
9 # FMILIB_License.txt file for more details.
\r
11 # You should have received a copy of the FMILIB_License.txt file
\r
12 # along with this program. If not, contact Modelon AB <http://www.modelon.com>.
\r
14 # fmi_platform(platform) sets platform to one of the by FMI defined platforms
\r
15 # win32, win64, linux32, linux64, darwin32 or darwin64 depending on cmake
\r
17 function(fmi_platform platform )
\r
18 if(CMAKE_HOST_WIN32) #Set to true when the host system is Windows and on cygwin.
\r
19 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
20 set(${platform} win32 PARENT_SCOPE)
\r
21 else(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
22 set(${platform} win64 PARENT_SCOPE)
\r
23 endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
24 elseif(CMAKE_HOST_APPLE) #Set to true when the host system is Apple OSX.
\r
25 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
26 set(${platform} darwin32 PARENT_SCOPE)
\r
27 else(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
28 set(${platform} darwin64 PARENT_SCOPE)
\r
29 endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
30 elseif(CMAKE_HOST_UNIX) #Set to true when the host system is UNIX or UNIX like (i.e. APPLE and CYGWIN).
\r
31 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
32 set(${platform} linux32 PARENT_SCOPE)
\r
33 else(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
34 set(${platform} linux64 PARENT_SCOPE)
\r
35 endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
\r
36 else(CMAKE_HOST_WIN32)
\r
37 message(SEND_ERROR "Target ${platform} is not supported by the tests")
\r
38 set(${platform} not_supported)
\r