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.

466 lines
16 KiB

  1. # Locate the Pantheois Logging Framework.
  2. #
  3. # Defines the following variables:
  4. #
  5. # PANTHEIOS_FOUND - Found the Pantheios Logging Framework
  6. # PANTHEIOS_INCLUDE_DIRS - Include directories
  7. #
  8. # Accepts the following variables as input:
  9. #
  10. # PANTHEIOS_ROOT - (as a CMake or environment variable)
  11. # The root directory of the pantheios install prefix
  12. #
  13. # PANTHEIOS_USE_DYNAMIC_RUNTIME
  14. #
  15. # If you want to use splitting, specify LRSplit and than preface the components with L and R, so e.g. LRSplit LFile RSyslog
  16. # To use more than one BackEnd, specify NBackEnd followed by a list of components. NBackEnd requires the NFrontEnd.
  17. #
  18. # Possible Components for BackEnd:
  19. # ACELogger
  20. # COMErrorObject
  21. # File
  22. # FileCallback
  23. # FPrintf
  24. # FPrintfCallback
  25. # Null
  26. # Speech
  27. # Syslog
  28. # WindowsConsole
  29. # WindowsConsoleCallback
  30. # WindowsDebugger
  31. # WindowsDebuggerCallback
  32. # WindowsEventLog
  33. # WindowsMessageBox
  34. # WindowsSyslog
  35. # WindowsSyslogCallback
  36. #
  37. # Possible components for FrontEnd:
  38. # NoFrontEnd
  39. # SimpleFrontEnd
  40. # NFrontEnd
  41. #
  42. #
  43. #=============================================================================
  44. # Copyright 2012 Philipp Berger <admin@philippberger.de>
  45. #
  46. # Distributed under the OSI-approved BSD License (the "License");
  47. # see accompanying file Copyright.txt for details.
  48. #
  49. # This software is distributed WITHOUT ANY WARRANTY; without even the
  50. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  51. # See the License for more information.
  52. #=============================================================================
  53. # (To distribute this file outside of CMake, substitute the full
  54. # License text for the above reference.)
  55. #
  56. # Credits:
  57. #
  58. # HUGE thanks to Michael Wild
  59. # Additional thanks to:
  60. # Mateusz Loskot
  61. # Rolf Eike Beer
  62. # default for WideString option
  63. set(PANTHEIOS_WIDESTRING 0)
  64. # default for Front- and BackEnd
  65. set(PANTHEIOS_FRONTEND "simple")
  66. set(PANTHEIOS_BACKEND "file")
  67. set(PANTHEIOS_BACKEND_L OFF)
  68. set(PANTHEIOS_BACKEND_R OFF)
  69. set(PANTHEIOS_BACKEND_LIST)
  70. # Use FIND_PACKAGE( Pantheios COMPONENTS ... ) to enable modules
  71. if( Pantheios_FIND_COMPONENTS )
  72. list(FIND Pantheios_FIND_COMPONENTS "LRSplit" PANTHEIOS_use_lrsplit)
  73. list(FIND Pantheios_FIND_COMPONENTS "NFrontEnd" PANTHEIOS_use_nfe)
  74. list(FIND Pantheios_FIND_COMPONENTS "NBackEnd" PANTHEIOS_use_nbe)
  75. list(FIND Pantheios_FIND_COMPONENTS "WideString" PANTHEIOS_use_ws)
  76. list(REMOVE_ITEM Pantheios_FIND_COMPONENTS "LRSplit" "NFrontEnd" "NBackEnd" "WideString")
  77. if (NOT PANTHEIOS_use_ws EQUAL -1)
  78. # Use WideString
  79. set(PANTHEIOS_WIDESTRING 1)
  80. endif()
  81. if (NOT PANTHEIOS_use_lrsplit EQUAL -1)
  82. # Found LRSplit
  83. set(PANTHEIOS_BACKEND "lrsplit")
  84. if (NOT PANTHEIOS_use_nbe EQUAL -1)
  85. # Also found NBe
  86. message(FATAL_ERROR "Pantheios: Use either LRSplit or NBackEnd, not both.")
  87. endif()
  88. if (NOT PANTHEIOS_use_nfe EQUAL -1)
  89. # Also found NFe
  90. message(FATAL_ERROR "Pantheios: Use either LRSplit or NFrontEnd, not both.")
  91. endif()
  92. foreach( component ${Pantheios_FIND_COMPONENTS} )
  93. # LRSplit L BackEnds
  94. string(SUBSTRING ${component} 0 1 _sub_comp_head)
  95. string(LENGTH ${component} _length_comp)
  96. math(EXPR _length_comp_tail "${_length_comp} - 1")
  97. string(SUBSTRING ${component} 1 ${_length_comp_tail} _sub_comp_tail)
  98. if ((_sub_comp_tail STREQUAL "ACELogger") OR (_sub_comp_tail STREQUAL "COMErrorObject") OR (_sub_comp_tail STREQUAL "File") OR (_sub_comp_tail STREQUAL "FileCallback") OR (_sub_comp_tail STREQUAL "FPrintf") OR (_sub_comp_tail STREQUAL "FPrintfCallback") OR (_sub_comp_tail STREQUAL "Null") OR (_sub_comp_tail STREQUAL "Speech") OR (_sub_comp_tail STREQUAL "Syslog") OR (_sub_comp_tail STREQUAL "WindowsConsole") OR (_sub_comp_tail STREQUAL "WindowsConsoleCallback") OR (_sub_comp_tail STREQUAL "WindowsDebugger") OR (_sub_comp_tail STREQUAL "WindowsDebuggerCallback") OR (_sub_comp_tail STREQUAL "WindowsEventLog") OR (_sub_comp_tail STREQUAL "WindowsMessageBox") OR (_sub_comp_tail STREQUAL "WindowsSyslog") OR (_sub_comp_tail STREQUAL "WindowsSyslogCallback"))
  99. if ((_sub_comp_head STREQUAL L) OR (_sub_comp_head STREQUAL R))
  100. message(STATUS "Pantheios: Setting LRSplit BackEnd ${_sub_comp_head} to ${_sub_comp_tail}")
  101. string(TOLOWER ${_sub_comp_tail} _sub_comp_tail_low)
  102. set(PANTHEIOS_BACKEND_${_sub_comp_head} "${_sub_comp_tail_low}")
  103. else ()
  104. message(FATAL_ERROR "Pantheios: Internal Parsing Error")
  105. endif()
  106. # FrontEnds
  107. elseif (component STREQUAL "NoFrontEnd")
  108. message(STATUS "Pantheios: Setting FrontEnd to NoFrontEnd")
  109. set(PANTHEIOS_FRONTEND "null")
  110. elseif (component STREQUAL "SimpleFrontEnd")
  111. message(STATUS "Pantheios: Setting FrontEnd to SimpleFrontEnd")
  112. set(PANTHEIOS_FRONTEND "simple")
  113. else ()
  114. message(FATAL_ERROR "Unknown Component: ${component}")
  115. endif ()
  116. endforeach(component)
  117. elseif (NOT PANTHEIOS_use_nbe EQUAL -1)
  118. # Found NBackEnd
  119. if (PANTHEIOS_use_nfe EQUAL -1)
  120. message(FATAL_ERROR "Pantheios: Usage of NBackEnd requires the NFrontEnd.")
  121. endif()
  122. set(PANTHEIOS_BACKEND "N")
  123. set(PANTHEIOS_FRONTEND "N")
  124. foreach( component ${Pantheios_FIND_COMPONENTS} )
  125. # Std BackEnds
  126. if ((component STREQUAL "ACELogger") OR (component STREQUAL "COMErrorObject") OR (component STREQUAL "File") OR (component STREQUAL "FileCallback") OR (component STREQUAL "FPrintf") OR (component STREQUAL "FPrintfCallback") OR (component STREQUAL "Null") OR (component STREQUAL "Speech") OR (component STREQUAL "Syslog") OR (component STREQUAL "WindowsConsole") OR (component STREQUAL "WindowsConsoleCallback") OR (component STREQUAL "WindowsDebugger") OR (component STREQUAL "WindowsDebuggerCallback") OR (component STREQUAL "WindowsEventLog") OR (component STREQUAL "WindowsMessageBox") OR (component STREQUAL "WindowsSyslog") OR (component STREQUAL "WindowsSyslogCallback"))
  127. message(STATUS "Pantheios: Adding BackEnd ${component}")
  128. string(TOLOWER ${component} _low_comp)
  129. list(APPEND PANTHEIOS_BACKEND_LIST ${_low_comp})
  130. else ()
  131. message(FATAL_ERROR "Unknown Component: ${component}")
  132. endif ()
  133. endforeach(component)
  134. else ()
  135. # Simple, one FE, one BE
  136. foreach( component ${Pantheios_FIND_COMPONENTS} )
  137. if ((component STREQUAL "ACELogger") OR (component STREQUAL "COMErrorObject") OR (component STREQUAL "File") OR (component STREQUAL "FileCallback") OR (component STREQUAL "FPrintf") OR (component STREQUAL "FPrintfCallback") OR (component STREQUAL "Null") OR (component STREQUAL "Speech") OR (component STREQUAL "Syslog") OR (component STREQUAL "WindowsConsole") OR (component STREQUAL "WindowsConsoleCallback") OR (component STREQUAL "WindowsDebugger") OR (component STREQUAL "WindowsDebuggerCallback") OR (component STREQUAL "WindowsEventLog") OR (component STREQUAL "WindowsMessageBox") OR (component STREQUAL "WindowsSyslog") OR (component STREQUAL "WindowsSyslogCallback"))
  138. message(STATUS "Pantheios: Setting BackEnd to ${component}")
  139. string(TOLOWER ${component} _low_comp)
  140. set(PANTHEIOS_BACKEND ${_low_comp})
  141. # FrontEnds
  142. elseif (component STREQUAL "NoFrontEnd")
  143. message(STATUS "Pantheios: Setting FrontEnd to NoFrontEnd")
  144. set(PANTHEIOS_FRONTEND "null")
  145. elseif (component STREQUAL "SimpleFrontEnd")
  146. message(STATUS "Pantheios: Setting FrontEnd to SimpleFrontEnd")
  147. set(PANTHEIOS_FRONTEND "simple")
  148. else ()
  149. message(FATAL_ERROR "Unknown Component: ${component}")
  150. endif ()
  151. endforeach(component)
  152. endif ()
  153. endif(Pantheios_FIND_COMPONENTS)
  154. if (PANTHEIOS_USE_DYNAMIC_RUNTIME)
  155. set(PANTHEIOS_LIB_LINKTYPE "dll")
  156. else ()
  157. set(PANTHEIOS_LIB_LINKTYPE "mt")
  158. endif ()
  159. if(PANTHEIOS_INCLUDE_DIR)
  160. if (NOT PANTHEIOS_ROOT)
  161. get_filename_component(PANTHEIOS_ROOT "${PANTHEIOS_INCLUDE_DIR}" PATH)
  162. endif()
  163. get_filename_component(PANTHEIOS_ROOT_HINT "${PANTHEIOS_INCLUDE_DIR}" PATH)
  164. endif()
  165. find_path(PANTHEIOS_INCLUDE_DIR pantheios/pantheios.h
  166. PATH_SUFFIXES include
  167. HINTS ${PANTHEIOS_ROOT} ${PANTHEIOS_ROOT_HINT}
  168. ENV PANTHEIOS_ROOT
  169. )
  170. # No idea what the stuff for ICC et. al. is, so I don't handle it here...
  171. set(_P_COMP_TAG)
  172. set(_P_OS_TAG)
  173. set(_P_ARCH_TAG)
  174. if(MSVC)
  175. if(MSVC60)
  176. set(_P_COMP_TAG vc6)
  177. elseif(MSVC70)
  178. set(_P_COMP_TAG vc7)
  179. elseif(MSVC71)
  180. set(_P_COMP_TAG vc71)
  181. elseif(MSVC80)
  182. set(_P_COMP_TAG vc8)
  183. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  184. set(_P_ARCH_TAG .x64)
  185. endif()
  186. elseif(MSVC90)
  187. set(_P_COMP_TAG vc9)
  188. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  189. set(_P_ARCH_TAG .x64)
  190. endif()
  191. elseif(MSVC10)
  192. set(_P_COMP_TAG vc10)
  193. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  194. set(_P_ARCH_TAG .x64)
  195. endif()
  196. elseif(MSVC11)
  197. set(_P_COMP_TAG vc11)
  198. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  199. set(_P_ARCH_TAG .x64)
  200. endif()
  201. endif()
  202. elseif(CMAKE_COMPILER_IS_GNUCC)
  203. execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
  204. string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
  205. list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
  206. list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
  207. set(_P_COMP_TAG gcc${GCC_MAJOR}${GCC_MINOR})
  208. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  209. set(_P_ARCH_TAG .file64bit)
  210. endif()
  211. else()
  212. message(FATAL_ERROR "Pantheios: Your compiler/environment is currently unsupported.")
  213. endif()
  214. set(_P_LIB_TAG ${_P_COMP_TAG}${_P_OS_TAG}${_P_ARCH_TAG})
  215. # Is this the right way?
  216. set(PANTHEIOS_INCLUDE_DIRS ${PANTHEIOS_INCLUDE_DIR})
  217. set(_P_REQUIRED_LIBVARS)
  218. set(PANTHEIOS_LIBRARIES)
  219. set(PANTHEIOS_LIBRARIES_DEBUG)
  220. set(PANTHEIOS_LIBRARIES_RELEASE)
  221. #core and util libraries
  222. foreach(l core util)
  223. find_library(PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_DEBUG_LIBRARY
  224. pantheios.1.${l}.${_P_LIB_TAG}.${PANTHEIOS_LIB_LINKTYPE}.debug
  225. PATH_SUFFIXES lib
  226. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  227. ENV PANTHEIOS_ROOT
  228. )
  229. find_library(PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY
  230. pantheios.1.${l}.${_P_LIB_TAG}.${PANTHEIOS_LIB_LINKTYPE}
  231. PATH_SUFFIXES lib
  232. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  233. ENV PANTHEIOS_ROOT
  234. )
  235. list(APPEND _P_REQUIRED_LIBVARS
  236. PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_DEBUG_LIBRARY
  237. PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY
  238. )
  239. list(APPEND PANTHEIOS_LIBRARIES
  240. debug ${PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_DEBUG_LIBRARY}
  241. optimized ${PANTHEIOS_${l}_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY}
  242. )
  243. endforeach()
  244. # set PANTHEIOS_LIBRARY_DIRS
  245. get_filename_component(PANTHEIOS_LIBRARY_DIRS ${PANTHEIOS_core_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY} PATH)
  246. # backend libraries (split, sole, local, remote and common)
  247. set(_P_LT ${PANTHEIOS_LIB_LINKTYPE})
  248. set(_P_BE ${PANTHEIOS_BACKEND})
  249. find_library(PANTHEIOS_be_${_P_BE}_${_P_LT}_DEBUG_LIBRARY
  250. pantheios.1.be.${_P_BE}.${_P_LIB_TAG}.${_P_LT}.debug
  251. PATH_SUFFIXES lib
  252. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  253. ENV PANTHEIOS_ROOT
  254. )
  255. find_library(PANTHEIOS_be_${_P_BE}_${_P_LT}_LIBRARY
  256. pantheios.1.be.${_P_BE}.${_P_LIB_TAG}.${_P_LT}
  257. PATH_SUFFIXES lib
  258. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  259. ENV PANTHEIOS_ROOT
  260. )
  261. list(APPEND _P_REQUIRED_LIBVARS
  262. PANTHEIOS_be_${_P_BE}_${_P_LT}_DEBUG_LIBRARY
  263. PANTHEIOS_be_${_P_BE}_${_P_LT}_LIBRARY
  264. )
  265. list(APPEND PANTHEIOS_LIBRARIES
  266. debug ${PANTHEIOS_be_${_P_BE}_${_P_LT}_DEBUG_LIBRARY}
  267. optimized ${PANTHEIOS_be_${_P_BE}_${_P_LT}_LIBRARY}
  268. )
  269. if (_P_BE STREQUAL N)
  270. # N Backend, go through list
  271. message(STATUS "Pantheios: Dbg: Lib-n")
  272. foreach (blib PANTHEIOS_BACKEND_LIST)
  273. find_library(PANTHEIOS_bec_${blib}_${_P_LT}_DEBUG_LIBRARY
  274. pantheios.1.bec.${blib}.${_P_LIB_TAG}.${_P_LT}.debug
  275. PATH_SUFFIXES lib
  276. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  277. ENV PANTHEIOS_ROOT
  278. )
  279. find_library(PANTHEIOS_bec_${blib}_${_P_LT}_LIBRARY
  280. pantheios.1.bec.${blib}.${_P_LIB_TAG}.${_P_LT}
  281. PATH_SUFFIXES lib
  282. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  283. ENV PANTHEIOS_ROOT
  284. )
  285. list(APPEND _P_REQUIRED_LIBVARS
  286. PANTHEIOS_bec_${blib}_${_P_LT}_DEBUG_LIBRARY
  287. PANTHEIOS_bec_${blib}_${_P_LT}_LIBRARY
  288. )
  289. list(APPEND PANTHEIOS_LIBRARIES
  290. debug ${PANTHEIOS_bec_${blib}_${_P_LT}_DEBUG_LIBRARY}
  291. optimized ${PANTHEIOS_bec_${blib}_${_P_LT}_LIBRARY}
  292. )
  293. endforeach()
  294. elseif (_P_BE STREQUAL lrsplit)
  295. # LRSplit
  296. message(STATUS "Pantheios: Dbg: Lib-lrsplit")
  297. # Left side
  298. foreach (t bec bel)
  299. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_DEBUG_LIBRARY
  300. pantheios.1.${t}.${PANTHEIOS_BACKEND_L}.${_P_LIB_TAG}.${_P_LT}.debug
  301. PATH_SUFFIXES lib
  302. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  303. ENV PANTHEIOS_ROOT
  304. )
  305. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_LIBRARY
  306. pantheios.1.${t}.${PANTHEIOS_BACKEND_L}.${_P_LIB_TAG}.${_P_LT}
  307. PATH_SUFFIXES lib
  308. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  309. ENV PANTHEIOS_ROOT
  310. )
  311. list(APPEND _P_REQUIRED_LIBVARS
  312. PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_DEBUG_LIBRARY
  313. PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_LIBRARY
  314. )
  315. list(APPEND PANTHEIOS_LIBRARIES
  316. debug ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_DEBUG_LIBRARY}
  317. optimized ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND_L}_${_P_LT}_LIBRARY}
  318. )
  319. endforeach()
  320. # Right side
  321. foreach (t bec ber)
  322. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_DEBUG_LIBRARY
  323. pantheios.1.${t}.${PANTHEIOS_BACKEND_R}.${_P_LIB_TAG}.${_P_LT}.debug
  324. PATH_SUFFIXES lib
  325. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  326. ENV PANTHEIOS_ROOT
  327. )
  328. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_LIBRARY
  329. pantheios.1.${t}.${PANTHEIOS_BACKEND_R}.${_P_LIB_TAG}.${_P_LT}
  330. PATH_SUFFIXES lib
  331. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  332. ENV PANTHEIOS_ROOT
  333. )
  334. list(APPEND _P_REQUIRED_LIBVARS
  335. PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_DEBUG_LIBRARY
  336. PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_LIBRARY
  337. )
  338. list(APPEND PANTHEIOS_LIBRARIES
  339. debug ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_DEBUG_LIBRARY}
  340. optimized ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND_R}_${_P_LT}_LIBRARY}
  341. )
  342. endforeach()
  343. else ()
  344. # normal
  345. message(STATUS "Pantheios: Dbg: Lib-normal")
  346. foreach (t bec)
  347. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_DEBUG_LIBRARY
  348. pantheios.1.${t}.${PANTHEIOS_BACKEND}.${_P_LIB_TAG}.${_P_LT}.debug
  349. PATH_SUFFIXES lib
  350. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  351. ENV PANTHEIOS_ROOT
  352. )
  353. find_library(PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_LIBRARY
  354. pantheios.1.${t}.${PANTHEIOS_BACKEND}.${_P_LIB_TAG}.${_P_LT}
  355. PATH_SUFFIXES lib
  356. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  357. ENV PANTHEIOS_ROOT
  358. )
  359. list(APPEND _P_REQUIRED_LIBVARS
  360. PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_DEBUG_LIBRARY
  361. PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_LIBRARY
  362. )
  363. list(APPEND PANTHEIOS_LIBRARIES
  364. debug ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_DEBUG_LIBRARY}
  365. optimized ${PANTHEIOS_${t}_${PANTHEIOS_BACKEND}_${_P_LT}_LIBRARY}
  366. )
  367. endforeach()
  368. endif()
  369. # frontent libraries
  370. set(PANTHEIOS_fe_DEBUG_LIBRARY)
  371. set(PANTHEIOS_fe_LIBRARY)
  372. if(NOT PANTHEIOS_FRONTENT STREQUAL null)
  373. set(_P_FE ${PANTHEIOS_FRONTEND})
  374. find_library(PANTHEIOS_${_P_FE}_${_P_LT}_DEBUG_LIBRARY
  375. pantheios.1.fe.${_P_FE}.${_P_LIB_TAG}.${_P_LT}.debug
  376. PATH_SUFFIXES lib
  377. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  378. ENV PANTHEIOS_ROOT
  379. )
  380. find_library(PANTHEIOS_${_P_FE}_${_P_LT}_LIBRARY
  381. pantheios.1.fe.${_P_FE}.${_P_LIB_TAG}.${_P_LT}
  382. PATH_SUFFIXES lib
  383. HINTS ${PANTHEIOS_ROOT_HINT} ${PANTHEIOS_ROOT}
  384. ENV PANTHEIOS_ROOT
  385. )
  386. list(APPEND _P_REQUIRED_LIBVARS
  387. PANTHEIOS_${_P_FE}_${_P_LT}_DEBUG_LIBRARY
  388. PANTHEIOS_${_P_FE}_${_P_LT}_LIBRARY
  389. )
  390. list(APPEND PANTHEIOS_LIBRARIES
  391. debug ${PANTHEIOS_${_P_FE}_${_P_LT}_DEBUG_LIBRARY}
  392. optimized ${PANTHEIOS_${_P_FE}_${_P_LT}_LIBRARY}
  393. )
  394. endif()
  395. # gcc needs the core library mentioned a second time at the end
  396. # (see Pantheios FAQ Q/A8)
  397. # At this point, the core has to be found already,
  398. # so only the additions to the lists are repeated here...
  399. if(CMAKE_COMPILER_IS_GNUCC)
  400. list(APPEND _P_REQUIRED_LIBVARS
  401. PANTHEIOS_core_${PANTHEIOS_LIB_LINKTYPE}_DEBUG_LIBRARY
  402. PANTHEIOS_core_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY
  403. )
  404. list(APPEND PANTHEIOS_LIBRARIES
  405. debug ${PANTHEIOS_core_${PANTHEIOS_LIB_LINKTYPE}_DEBUG_LIBRARY}
  406. optimized ${PANTHEIOS_core_${PANTHEIOS_LIB_LINKTYPE}_LIBRARY}
  407. )
  408. endif()
  409. # copy to NAME_LIBS
  410. set(PANTHEIOS_LIBS ${PANTHEIOS_LIBRARIES})
  411. # handle the QUIETLY and REQUIRED arguments and set Pantheios_FOUND to TRUE if
  412. # all listed variables are TRUE
  413. include(FindPackageHandleStandardArgs)
  414. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pantheios
  415. REQUIRED_VARS PANTHEIOS_INCLUDE_DIR ${_P_REQUIRED_LIBVARS}
  416. )
  417. message(STATUS ${PANTHEIOS_INCLUDE_DIR} ${PANTHEIOS_LIBRARIES})
  418. mark_as_advanced(PANTHEIOS_INCLUDE_DIR PANTHEIOS_LIBRARIES)