CMakeLists.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ----------------------------------------------------------------------------
  2. # CMake file for Intel ITT API. See root CMakeLists.txt
  3. #
  4. # ----------------------------------------------------------------------------
  5. if(NOT ITT_LIBRARY)
  6. set(ITT_LIBRARY "ittnotify")
  7. endif()
  8. project(${ITT_LIBRARY} C)
  9. if(NOT WIN32)
  10. include(CheckLibraryExists)
  11. if(COMMAND CHECK_LIBRARY_EXISTS)
  12. CHECK_LIBRARY_EXISTS(dl dlerror "" HAVE_DL_LIBRARY)
  13. endif()
  14. endif()
  15. ocv_warnings_disable(CMAKE_C_FLAGS -Wimplicit-fallthrough)
  16. ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
  17. set(ITT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
  18. set(ITT_PUBLIC_HDRS
  19. include/ittnotify.h
  20. include/jitprofiling.h
  21. include/libittnotify.h
  22. include/llvm_jit_event_listener.hpp
  23. )
  24. set(ITT_PRIVATE_HDRS
  25. src/ittnotify/disable_warnings.h
  26. src/ittnotify/ittnotify_config.h
  27. src/ittnotify/ittnotify_static.h
  28. src/ittnotify/ittnotify_types.h
  29. )
  30. set(ITT_SRCS
  31. src/ittnotify/ittnotify_static.c
  32. src/ittnotify/jitprofiling.c
  33. )
  34. add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
  35. if(NOT WIN32)
  36. if(HAVE_DL_LIBRARY)
  37. target_link_libraries(${ITT_LIBRARY} dl)
  38. endif()
  39. endif()
  40. set_target_properties(${ITT_LIBRARY} PROPERTIES
  41. OUTPUT_NAME ${ITT_LIBRARY}
  42. DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
  43. COMPILE_PDB_NAME ${ITT_LIBRARY}
  44. COMPILE_PDB_NAME_DEBUG "${ITT_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
  45. ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
  46. )
  47. ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wsign-compare)
  48. if(ENABLE_SOLUTION_FOLDERS)
  49. set_target_properties(${ITT_LIBRARY} PROPERTIES FOLDER "3rdparty")
  50. endif()
  51. if(NOT BUILD_SHARED_LIBS)
  52. ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
  53. endif()
  54. ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)