A SystemC productivity library for virtual platform development utilizing SCV and TLM2.0 https://www.minres.com/#opensource

FindSystemC.cmake 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. SET(_COMMON_HINTS
  2. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SystemC\\2.3;SystemcHome]/include"
  3. ${SYSTEMC_PREFIX}/include
  4. ${SYSTEMC_PREFIX}/lib
  5. ${SYSTEMC_PREFIX}/lib-linux
  6. ${SYSTEMC_PREFIX}/lib-linux64
  7. ${SYSTEMC_PREFIX}/lib-macos
  8. $ENV{SYSTEMC_PREFIX}/include
  9. $ENV{SYSTEMC_PREFIX}/lib
  10. $ENV{SYSTEMC_PREFIX}/lib-linux
  11. $ENV{SYSTEMC_PREFIX}/lib-linux64
  12. $ENV{SYSTEMC_PREFIX}/lib-macos
  13. $ENV{SYSTEMC_HOME}/include
  14. $ENV{SYSTEMC_HOME}/lib
  15. $ENV{SYSTEMC_HOME}/lib-linux
  16. $ENV{SYSTEMC_HOME}/lib-linux64
  17. $ENV{SYSTEMC_HOME}/lib-macos
  18. ${CMAKE_INSTALL_PREFIX}/include
  19. ${CMAKE_INSTALL_PREFIX}/lib
  20. ${CMAKE_INSTALL_PREFIX}/lib-linux
  21. ${CMAKE_INSTALL_PREFIX}/lib-linux64
  22. ${CMAKE_INSTALL_PREFIX}/lib-macos
  23. )
  24. SET(_SYSTEMC_HINTS
  25. ${CONAN_INCLUDE_DIRS_SYSTEMC}
  26. ${CONAN_LIB_DIRS_SYSTEMC}
  27. ${_COMMON_HINTS}
  28. )
  29. SET(_SCV_HINTS
  30. ${CONAN_INCLUDE_DIRS_SYSTEMCVERIFICATION}
  31. ${CONAN_LIB_DIRS_SYSTEMCVERIFICATION}
  32. $ENV{SCV_HOME}/include
  33. $ENV{SCV_HOME}/lib
  34. $ENV{SCV_HOME}/lib-linux
  35. $ENV{SCV_HOME}/lib-linux64
  36. $ENV{SCV_HOME}/lib-macos
  37. ${_COMMON_HINTS}
  38. )
  39. SET(_CCI_HINTS
  40. ${CONAN_INCLUDE_DIRS_SYSTEMC-CCI}
  41. ${CONAN_LIB_DIRS_SYSTEMC-CCI}
  42. $ENV{CCI_HOME}/include
  43. $ENV{CCI_HOME}/src
  44. $ENV{CCI_HOME}/lib
  45. $ENV{CCI_HOME}/lib-linux
  46. $ENV{CCI_HOME}/lib-linux64
  47. $ENV{CCI_HOME}/lib-macos
  48. ${_COMMON_HINTS}
  49. )
  50. SET(_COMMON_PATHS
  51. /usr/include/systemc
  52. /usr/lib
  53. /usr/lib-linux
  54. /usr/lib-linux64
  55. /usr/lib-macos
  56. /usr/local/include/sysc
  57. /usr/local/lib
  58. /usr/local/lib-linux
  59. /usr/local/lib-linux64
  60. /usr/local/lib-macos
  61. )
  62. FIND_FILE(_SYSTEMC_HEADER_FILE
  63. NAMES systemc
  64. HINTS ${_SYSTEMC_HINTS}
  65. PATHS ${_COMMON_PATHS}
  66. )
  67. FIND_FILE(_SCV_HEADER_FILE
  68. NAMES scv.h
  69. HINTS ${_SCV_HINTS}
  70. PATHS ${_COMMON_PATHS}
  71. )
  72. FIND_FILE(_CCI_HEADER_FILE
  73. NAMES cci_configuration
  74. HINTS ${_CCI_HINTS}
  75. PATHS ${_COMMON_PATHS}
  76. )
  77. if(NOT _SYSTEMC_HEADER_FILE STREQUAL _SYSTEMC_HEADER_FILE-NOTFOUND)
  78. set(SystemC_FOUND TRUE)
  79. endif()
  80. if(ENABLE_SCV)
  81. if(NOT _SCV_HEADER_FILE STREQUAL _SCV_HEADER_FILE-NOTFOUND)
  82. set(SCV_FOUND TRUE)
  83. endif()
  84. endif()
  85. if(NOT _CCI_HEADER_FILE STREQUAL _CCI_HEADER_FILE-NOTFOUND)
  86. set(CCI_FOUND TRUE)
  87. endif()
  88. FIND_PATH(SystemC_INCLUDE_DIRS
  89. NAMES systemc.h
  90. HINTS ${_SYSTEMC_HINTS}
  91. PATHS ${_SYSTEMC_PATHS}
  92. )
  93. FIND_PATH(SystemC_LIBRARY_DIRS
  94. NAMES libsystemc.so libsystemc.a
  95. HINTS ${_SYSTEMC_HINTS}
  96. PATHS ${_SYSTEMC_PATHS}
  97. )
  98. FIND_PATH(SCV_INCLUDE_DIRS
  99. NAMES scv.h
  100. HINTS ${_SCV_HINTS}
  101. PATHS ${_SCV_PATHS}
  102. )
  103. FIND_PATH(SCV_LIBRARY_DIRS
  104. NAMES libscv.a libscv.so
  105. HINTS ${_SCV_HINTS}
  106. PATHS ${_SCV_PATHS}
  107. )
  108. FIND_PATH(CCI_INCLUDE_DIRS
  109. NAMES cci_configuration
  110. HINTS ${_CCI_HINTS}
  111. PATHS ${_CCI_PATHS}
  112. )
  113. FIND_PATH(CCI_LIBRARY_DIRS
  114. NAMES libcciapi.a libcciapi.so
  115. HINTS ${_CCI_HINTS}
  116. PATHS ${_CCI_PATHS}
  117. )
  118. if(SystemC_FOUND)
  119. set(SystemC_LIBRARIES systemc)
  120. if(SCV_FOUND)
  121. set(SCV_LIBRARIES scv)
  122. endif(SCV_FOUND)
  123. if(CCI_FOUND)
  124. set(CCI_LIBRARIES cciapi)
  125. endif()
  126. endif(SystemC_FOUND)