Salome HOME
Additional fix of libxml2 check procedures for PARAVIS compilation (Linux)
[modules/kernel.git] / salome_adm / cmake_files / FindPLATFORM.cmake
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 MARK_AS_ADVANCED(ISSUE)
24 FIND_FILE(ISSUE issue /etc)
25 IF(ISSUE)
26   SET(WINDOWS 0)
27 ELSE()
28   SET(WINDOWS 1)
29 ENDIF(ISSUE)
30
31 IF(WINDOWS)
32   SET(MACHINE WINDOWS)
33 ELSE(WINDOWS)
34   SET(MACHINE PCLINUX)
35 ENDIF(WINDOWS)
36
37 SET(CMAKE_INSTALL_PREFIX_ENV $ENV{CMAKE_INSTALL_PREFIX})
38 IF(CMAKE_INSTALL_PREFIX_ENV)
39   SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_ENV} CACHE PATH "installation prefix" FORCE)
40 ENDIF(CMAKE_INSTALL_PREFIX_ENV)
41
42 IF(NOT CMAKE_BUILD_TYPE)
43   SET(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE})
44 ENDIF(NOT CMAKE_BUILD_TYPE)
45
46 IF(CMAKE_BUILD_TYPE)
47   IF(WINDOWS)
48     MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES)
49     SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE)
50   ELSE(WINDOWS)
51     IF(CMAKE_BUILD_TYPE STREQUAL Release)
52       SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG")
53       SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
54     ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
55   ENDIF(WINDOWS)
56 ENDIF(CMAKE_BUILD_TYPE)
57
58 SET(PLATFORM_CPPFLAGS)
59 SET(PLATFORM_LDFLAGS)
60 SET(PLATFORM_LIBADD)
61 IF(WINDOWS)
62   SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0)
63   SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT)
64   SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile
65   SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM
66   SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required
67   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib)
68   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit
69 ELSE(WINDOWS)
70   SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
71 ENDIF(WINDOWS)
72
73 SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4)
74
75 #  SET(PLATFORM_CPPFLAGS)
76 #  #  #  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS)
77 #  #  SET(RM del)
78 #ELSE(WINDOWS)
79 #  #  SET(RM /bin/rm)
80 #ENDIF(WINDOWS)
81
82 ### SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_DEBUG_)
83
84 ##SET(RCP rcp)
85 ##SET(RSH rsh)
86 ##SET(RCP rcp)
87
88 ## MESSAGE(FATAL_ERROR "ZZZZZZZ")