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