]>
Commit | Line | Data |
---|---|---|
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 | ||
30 | execute_process (COMMAND sw_vers | sed -n 's/ProductVersion://p' | cut -d. -f1 | |
31 | OUTPUT_VARIABLE MACOSX_MAJOR | |
32 | OUTPUT_STRIP_TRAILING_WHITESPACE ) | |
33 | execute_process (COMMAND sw_vers | sed -n 's/ProductVersion://p' | cut -d. -f2 | |
34 | OUTPUT_VARIABLE MACOSX_MINOR | |
35 | OUTPUT_STRIP_TRAILING_WHITESPACE ) | |
36 | ||
37 | set(FINK_ROOT $ENV{FINK_ROOT}) | |
38 | if( NOT FINK_ROOT ) | |
39 | ||
40 | set ( FINK_ROOT /usr/local) | |
41 | ||
42 | endif( NOT FINK_ROOT ) | |
aecc2ba0 | 43 | |
44 | # Global Optimization | |
45 | set ( OPT ) | |
46 | # ------- Setting optimization flags for default configuration ------- | |
47 | if((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}") | |
51 | endif((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "None")) | |
52 | # -------------------------------------------------------------------- | |
53 | set ( NOOPT "-g") | |
03d1e24f | 54 | |
55 | set ( CXXOPT ${OPT}) | |
56 | set ( CXXNOOPT ${NOOPT}) | |
57 | set ( COPT ${OPT}) | |
58 | ||
59 | if( F77 MATCHES "g95") | |
60 | ||
61 | set ( FOPT "${FOPT} -fbounds-check") | |
62 | ||
63 | endif( F77 MATCHES "g95") | |
64 | ||
65 | set ( CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC") | |
66 | set ( CLIBCXXOPTS ) | |
67 | set ( CLIBCOPT ) | |
68 | set ( CLIBFOPT ${CLIBDEFS}) | |
69 | ||
320606a7 | 70 | set ( CXXWARN "-Wall -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual") |
03d1e24f | 71 | |
550a51af | 72 | if ( 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 | ||
76 | else( 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") | |
320606a7 | 79 | set (CXXWARN "${CXXWARN} -ansi") |
550a51af | 80 | |
81 | endif( CMAKE_CXX_COMPILER MATCHES "clang") | |
82 | ||
03d1e24f | 83 | set ( CXXFLAGS "${CXXOPT} ${CXXSTF}") |
84 | ||
85 | set ( CXXFLAGSNO "${CXXNOOPT} ${CXXSTF}") | |
86 | ||
87 | set ( CFLAGS "${COPT} -Wall -W -fno-common -pipe -I${FINK_ROOT}/include") | |
88 | ||
ceab6e7b | 89 | set ( FFLAGS "${FFLAGS} -m64 -DFORTRAN_GFORTRAN") |
03d1e24f | 90 | |
91 | set ( CINTFLAGS ) | |
92 | ||
93 | set ( LDFLAGS "${OPT} ${DICTLOAD}") | |
94 | ||
95 | set ( SOFLAGS "-m64 -dynamiclib -undefined dynamic_lookup -single_module") | |
96 | ||
97 | set ( ALLIB ) | |
98 | ||
99 | set ( SYSLIBS "-L/usr/X11R6/lib -lX11") | |
100 | ||
03d1e24f | 101 | set ( EXEFLAGS "-bind_at_load") |
102 | ||
f5cec7ba | 103 | execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortran.dylib |
104 | OUTPUT_VARIABLE _shlib | |
105 | OUTPUT_STRIP_TRAILING_WHITESPACE) | |
106 | execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -m64 -print-file-name=libgfortranbegin.a | |
107 | OUTPUT_VARIABLE _alib | |
108 | OUTPUT_STRIP_TRAILING_WHITESPACE) | |
109 | set( SYSLIBS "${SYSLIBS} -ldl ${_shlib} ${_alib}") | |
110 |