Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.4 KiB

  1. # Try to find gnu scientific library GSL
  2. # See
  3. # http://www.gnu.org/software/gsl/ and
  4. # http://gnuwin32.sourceforge.net/packages/gsl.htm
  5. #
  6. # Based on a script of Felix Woelk and Jan Woetzel
  7. # (www.mip.informatik.uni-kiel.de)
  8. #
  9. # It defines the following variables:
  10. # GSL_FOUND - system has GSL lib
  11. # GSL_INCLUDE_DIRS - where to find headers
  12. # GSL_LIBRARIES - full path to the libraries
  13. # GSL_LIBRARY_DIRS, the directory where the PLplot library is found.
  14. # GSL_CFLAGS, additional c (c++) required
  15. message(STATUS "Look for GSL in folder: $ENV{GSL_DIR}")
  16. set( GSL_FOUND OFF )
  17. set( GSL_CBLAS_FOUND OFF )
  18. if(GSL_INCLUDE_DIR OR GSL_CONFIG_EXECUTABLE)
  19. set(GSL_FIND_QUIETLY 1)
  20. endif()
  21. # Windows, but not for Cygwin and MSys where gsl-config is available
  22. if( WIN32 AND NOT CYGWIN AND NOT MSYS )
  23. # look for headers
  24. find_path( GSL_INCLUDE_DIR
  25. NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
  26. PATHS $ENV{GSL_DIR}/include ${GSL_DIR}/include
  27. )
  28. if( GSL_INCLUDE_DIR )
  29. # look for gsl library
  30. find_library( GSL_LIBRARY
  31. NAMES gsl
  32. PATHS $ENV{GSL_DIR}/lib ${GSL_DIR}/lib
  33. )
  34. if( GSL_LIBRARY )
  35. set( GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
  36. get_filename_component( GSL_LIBRARY_DIRS ${GSL_LIBRARY} PATH )
  37. set( GSL_FOUND ON )
  38. endif( GSL_LIBRARY )
  39. # look for gsl cblas library
  40. find_library( GSL_CBLAS_LIBRARY
  41. NAMES gslcblas
  42. PATHS $ENV{GSL_DIR}/lib ${GSL_DIR}/lib
  43. )
  44. if( GSL_CBLAS_LIBRARY )
  45. set( GSL_CBLAS_FOUND ON )
  46. endif( GSL_CBLAS_LIBRARY )
  47. set( GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY} )
  48. set( GSL_CFLAGS "-DGSL_DLL")
  49. endif( GSL_INCLUDE_DIR )
  50. mark_as_advanced(
  51. GSL_INCLUDE_DIR
  52. GSL_LIBRARY
  53. GSL_CBLAS_LIBRARY
  54. )
  55. else( WIN32 AND NOT CYGWIN AND NOT MSYS )
  56. if( UNIX OR MSYS )
  57. find_program( GSL_CONFIG_EXECUTABLE gsl-config
  58. $ENV{GSL_DIR}/bin
  59. ${GSL_DIR}/bin
  60. /usr/bin/
  61. /usr/local/bin
  62. )
  63. if( GSL_CONFIG_EXECUTABLE )
  64. set( GSL_FOUND ON )
  65. # run the gsl-config program to get cxxflags
  66. execute_process(
  67. COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --cflags
  68. OUTPUT_VARIABLE GSL_CFLAGS
  69. RESULT_VARIABLE RET
  70. ERROR_QUIET
  71. )
  72. if( RET EQUAL 0 )
  73. string( STRIP "${GSL_CFLAGS}" GSL_CFLAGS )
  74. separate_arguments( GSL_CFLAGS )
  75. # parse definitions from cflags; drop -D* from CFLAGS
  76. string( REGEX MATCHALL "-D[^;]+"
  77. GSL_DEFINITIONS "${GSL_CFLAGS}" )
  78. string( REGEX REPLACE "-D[^;]+;" ""
  79. GSL_CFLAGS "${GSL_CFLAGS}" )
  80. # parse include dirs from cflags; drop -I prefix
  81. string( REGEX MATCHALL "-I[^;]+"
  82. GSL_INCLUDE_DIRS "${GSL_CFLAGS}" )
  83. string( REPLACE "-I" ""
  84. GSL_INCLUDE_DIRS "${GSL_INCLUDE_DIRS}")
  85. string( REGEX REPLACE "-I[^;]+;" ""
  86. GSL_CFLAGS "${GSL_CFLAGS}")
  87. else( RET EQUAL 0 )
  88. set( GSL_FOUND FALSE )
  89. endif( RET EQUAL 0 )
  90. # run the gsl-config program to get the libs
  91. execute_process(
  92. COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --libs
  93. OUTPUT_VARIABLE GSL_LIBRARIES
  94. RESULT_VARIABLE RET
  95. ERROR_QUIET
  96. )
  97. if( RET EQUAL 0 )
  98. string(STRIP "${GSL_LIBRARIES}" GSL_LIBRARIES )
  99. separate_arguments( GSL_LIBRARIES )
  100. # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
  101. string( REGEX MATCHALL "-L[^;]+"
  102. GSL_LIBRARY_DIRS "${GSL_LIBRARIES}" )
  103. string( REPLACE "-L" ""
  104. GSL_LIBRARY_DIRS "${GSL_LIBRARY_DIRS}" )
  105. else( RET EQUAL 0 )
  106. set( GSL_FOUND FALSE )
  107. endif( RET EQUAL 0 )
  108. MARK_AS_ADVANCED(
  109. GSL_CFLAGS
  110. )
  111. if(NOT GSL_FIND_QUIETLY)
  112. execute_process(
  113. COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --prefix
  114. OUTPUT_VARIABLE GSL_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
  115. message( STATUS "Using GSL from ${GSL_PREFIX}")
  116. endif()
  117. else( GSL_CONFIG_EXECUTABLE )
  118. message( STATUS "FindGSL: gsl-config not found.")
  119. endif( GSL_CONFIG_EXECUTABLE )
  120. endif( UNIX OR MSYS )
  121. endif( WIN32 AND NOT CYGWIN AND NOT MSYS )
  122. if( GSL_FOUND )
  123. if( NOT GSL_FIND_QUIETLY )
  124. message( STATUS "Found GSL: ${GSL_INCLUDE_DIRS} ${GSL_LIBRARIES}" )
  125. endif( NOT GSL_FIND_QUIETLY )
  126. else( GSL_FOUND )
  127. if( GSL_FIND_REQUIRED )
  128. message( FATAL_ERROR "FindGSL: Could not find GSL headers or library" )
  129. endif( GSL_FIND_REQUIRED )
  130. endif( GSL_FOUND )
  131. mark_as_advanced(
  132. GSL_CONFIG_EXECUTABLE
  133. GSL_INCLUDE_DIR
  134. GSL_LIBRARY
  135. GSL_CBLAS_LIBRARY
  136. )