#101318: Patch for various problems in AliROOT
[u/mrichter/AliRoot.git] / cmake / CMakemacosx64.cmake
CommitLineData
fc03a176 1# -*- mode: cmake -*-
2
03d1e24f 3#--------------------------------------------------------------------------------#
4# Package File for #
5# Author : Johny Jose (johny.jose@cern.ch) #
6# Variables Defined : #
7# #
8# SRCS - C++ source files #
9# HDRS - C++ header files #
10# DHDR - ROOT Dictionary Linkdef header file #
11# CSRCS - C source files #
12# CHDRS - C header files #
13# EINCLUDE - Include directories #
14# EDEFINE - Compiler definitions #
15# ELIBS - Extra libraries to link #
16# ELIBSDIR - Extra library directories #
17# PACKFFLAGS - Fortran compiler flags for package #
18# PACKCXXFLAGS - C++ compiler flags for package #
19# PACKCFLAGS - C compiler flags for package #
20# PACKSOFLAGS - Shared library linking flags #
21# PACKLDFLAGS - Module linker flags #
22# PACKBLIBS - Libraries to link (Executables only) #
23# EXPORT - Header files to be exported #
24# CINTHDRS - Dictionary header files #
25# CINTAUTOLINK - Set automatic dictionary generation #
26# ARLIBS - Archive Libraries and objects for linking (Executables only) #
27# SHLIBS - Shared Libraries and objects for linking (Executables only) #
28#--------------------------------------------------------------------------------#
29
30execute_process (COMMAND sw_vers | sed -n 's/ProductVersion://p' | cut -d. -f1
31 OUTPUT_VARIABLE MACOSX_MAJOR
32 OUTPUT_STRIP_TRAILING_WHITESPACE )
33execute_process (COMMAND sw_vers | sed -n 's/ProductVersion://p' | cut -d. -f2
34 OUTPUT_VARIABLE MACOSX_MINOR
35 OUTPUT_STRIP_TRAILING_WHITESPACE )
36
37set(FINK_ROOT $ENV{FINK_ROOT})
38if( NOT FINK_ROOT )
39
40 set ( FINK_ROOT /usr/local)
41
42endif( NOT FINK_ROOT )
aecc2ba0 43
44# Global Optimization
45set ( OPT )
46# ------- Setting optimization flags for default configuration -------
47if((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "None"))
48 set(DEFAULT_CXX_FLAGS "-O -g")
49 set(OPT "${DEFAULT_CXX_FLAGS}")
50 message("-- Setting compiler flags for default configuration: ${DEFAULT_CXX_FLAGS}")
51endif((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "None"))
52# --------------------------------------------------------------------
53set ( NOOPT "-g")
03d1e24f 54
55set ( CXXOPT ${OPT})
56set ( CXXNOOPT ${NOOPT})
57set ( COPT ${OPT})
58
59if( F77 MATCHES "g95")
60
61 set ( FOPT "${FOPT} -fbounds-check")
62
63endif( F77 MATCHES "g95")
64
65set ( CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")
66set ( CLIBCXXOPTS )
67set ( CLIBCOPT )
68set ( CLIBFOPT ${CLIBDEFS})
69
e3d9d369 70set ( CXXWARN "-Wall -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi")
03d1e24f 71
550a51af 72if ( CMAKE_CXX_COMPILER MATCHES "clang")
73
74 set ( CXXSTF "-pipe -fsigned-char -fno-common -fmessage-length=0 -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
75
76else( CMAKE_CXX_COMPILER MATCHES "clang")
77
78 set ( CXXSTF "-pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
79
80endif( CMAKE_CXX_COMPILER MATCHES "clang")
81
03d1e24f 82
83set ( CXXFLAGS "${CXXOPT} ${CXXSTF}")
84
85set ( CXXFLAGSNO "${CXXNOOPT} ${CXXSTF}")
86
87set ( CFLAGS "${COPT} -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")
88
ceab6e7b 89set ( FFLAGS "${FFLAGS} -m64 -DFORTRAN_GFORTRAN")
03d1e24f 90
91set ( CINTFLAGS )
92
93set ( LDFLAGS "${OPT} ${DICTLOAD}")
94
95set ( SOFLAGS "-m64 -dynamiclib -undefined dynamic_lookup -single_module")
96
97set ( ALLIB )
98
99set ( SYSLIBS "-L/usr/X11R6/lib -lX11")
100
03d1e24f 101set ( EXEFLAGS "-bind_at_load")
102
f5cec7ba 103execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortran.dylib
104 OUTPUT_VARIABLE _shlib
105 OUTPUT_STRIP_TRAILING_WHITESPACE)
106execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortranbegin.a
107 OUTPUT_VARIABLE _alib
108 OUTPUT_STRIP_TRAILING_WHITESPACE)
109set( SYSLIBS "${SYSLIBS} -ldl ${_shlib} ${_alib}")
110