Additional patch for #83850: Please consider deprecating CINTAUTOLINK (Christian)
[u/mrichter/AliRoot.git] / cmake / CMakelinuxicc.cmake
CommitLineData
03d1e24f 1#--------------------------------------------------------------------------------#
2# Package File for #
3# Author : Johny Jose (johny.jose@cern.ch) #
4# Variables Defined : #
5# #
6# SRCS - C++ source files #
7# HDRS - C++ header files #
8# DHDR - ROOT Dictionary Linkdef header file #
9# CSRCS - C source files #
10# CHDRS - C header files #
11# EINCLUDE - Include directories #
12# EDEFINE - Compiler definitions #
13# ELIBS - Extra libraries to link #
14# ELIBSDIR - Extra library directories #
15# PACKFFLAGS - Fortran compiler flags for package #
16# PACKCXXFLAGS - C++ compiler flags for package #
17# PACKCFLAGS - C compiler flags for package #
18# PACKSOFLAGS - Shared library linking flags #
19# PACKLDFLAGS - Module linker flags #
20# PACKBLIBS - Libraries to link (Executables only) #
21# EXPORT - Header files to be exported #
22# CINTHDRS - Dictionary header files #
23# CINTAUTOLINK - Set automatic dictionary generation #
24# ARLIBS - Archive Libraries and objects for linking (Executables only) #
25# SHLIBS - Shared Libraries and objects for linking (Executables only) #
26#--------------------------------------------------------------------------------#
27
28
29execute_process (COMMAND ${CMAKE_C_COMPILER} -V 2>&1 | awk '{ if (NR == 1) print $$8}' | cut -d'.' -f1
30 OUTPUT_VARIABLE ICC_MAJOR
31 OUTPUT_STRIP_TRAILING_WHITESPACE)
32execute_process (COMMAND ${CMAKE_C_COMPILER} -V 2>&1 | awk '{ if(NR == 1) print $$8}' | cut -d'.' -f2
33 OUTPUT_VARIABLE ICC_MINOR
34 OUTPUT_STRIP_TRAILING_WHITESPACE)
35
aecc2ba0 36# Global Optimization
03d1e24f 37set ( OPT "-O -ip")
aecc2ba0 38# ------- Setting optimization flags for default configuration -------
39if((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "None"))
40 set(DEFAULT_CXX_FLAGS "-O -g")
41 set(OPT "${DEFAULT_CXX_FLAGS}")
42 message("-- Setting compiler flags for default configuration: ${DEFAULT_CXX_FLAGS}")
43endif((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "None"))
44# --------------------------------------------------------------------
03d1e24f 45set ( NOOPT "-O0")
46
47set ( CXXOPT "${OPT} -fPIC")
48set ( CXXNOOPT "${NOOPT} -fPIC")
49set ( COPT "${OPT} -fPIC")
50set ( FOPT "${OPT} -fPIC")
51
52set ( CLIBDEFS "-DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ")
53set ( CLIBCXXOPTS )
54set ( CLIBCOPT )
55set ( CLIBFOPT ${CLIBDEFS})
56
57set ( CXXFLAGS ${CXXOPT})
58set ( CXXFLAGSNO ${CXXNOOPT})
59set ( CFLAGS ${COPT})
60set ( FFLAGS "${CLIBFOPT} ${FOPT}")
61set ( DEPENDFFLAGS ${FFLAGS})
62
63set ( CINTFLAGS )
64
65set ( LDFLAGS ${OPT})
66
67set ( SOFLAGS "-shared")
68
69set ( ALLIB )
70
71execute_process(COMMAND find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'
72 OUTPUT_VARIABLE LIBNOVER
73 OUTPUT_STRIP_TRAILING_WHITESPACE)
74
75execute_process(COMMAND which ifort | sed -e 's|bin|lib|' | sed -e 's|ifor||'
76 OUTPUT_VARIABLE IFORT
77 OUTPUT_STRIP_TRAILING_WHITESPACE)
78
79set (SYSLIBS "-lcrypt -L/usr/X11R6/lib -lX11 ${LIBNOVER} -L/usr/local/lib -lXt -L${IFORT} -lifcore -lifport")
80