Adding ruleckecher files into the distribbution
[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
72set ( CXXSTF "-pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
73
74set ( CXXFLAGS "${CXXOPT} ${CXXSTF}")
75
76set ( CXXFLAGSNO "${CXXNOOPT} ${CXXSTF}")
77
78set ( CFLAGS "${COPT} -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")
79
80if(F77 MATCHES "g95")
81
82 set ( FFLAGS "${FFLAGS} -ftrace=full")
83 set ( FFLAGS "${FFLAGS} -DFORTRAN_G95")
84
85else()
86
87 set ( FFLAGS "${FFLAGS} -DFORTRAN_GFORTRAN")
88
89endif(F77 MATCHES "g95")
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
101
102set ( EXEFLAGS "-bind_at_load")
103
104if( F77 MATCHES "g95")
105
106 execute_process(COMMAND ${CMAKE_Fortran_COMPILER} --print-search-dirs
107 OUTPUT_VARIABLE SYSLIBS
108 OUTPUT_STRIP_TRAILING_WHITESPACE)
109 string(REGEX MATCH "^.*install:[^\n]*" SYSLIBS ${SYSLIBS})
110 string(REGEX REPLACE "^.*install: " "" SYSLIBS ${SYSLIBS})
111 set(SYSLIBS "-L${SHLIB} -lf95")
112 set(DYLIB ${SYSLIBS})
113
114else()
a9fc72d7 115
116 execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortran.dylib
03d1e24f 117 OUTPUT_VARIABLE _shlib
118 OUTPUT_STRIP_TRAILING_WHITESPACE)
a9fc72d7 119 execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortranbegin.a
03d1e24f 120 OUTPUT_VARIABLE _alib
121 OUTPUT_STRIP_TRAILING_WHITESPACE)
122 set( SYSLIBS "${SYSLIBS} -ldl ${_shlib} ${_alib}")
123
124endif(F77 MATCHES "g95")