Add customised cpu optimization build options
[platform/upstream/opencv.git] / 3rdparty / ittnotify / CMakeLists.txt
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 if(NOT WIN32)
12   include(CheckLibraryExists)
13   if(COMMAND CHECK_LIBRARY_EXISTS)
14     CHECK_LIBRARY_EXISTS(dl dlerror "" HAVE_DL_LIBRARY)
15   endif()
16 endif()
17
18 ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
19 set(ITT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
20
21 set(ITT_PUBLIC_HDRS
22     include/ittnotify.h
23     include/jitprofiling.h
24     include/libittnotify.h
25     include/llvm_jit_event_listener.hpp
26 )
27 set(ITT_PRIVATE_HDRS
28     src/ittnotify/disable_warnings.h
29     src/ittnotify/ittnotify_config.h
30     src/ittnotify/ittnotify_static.h
31     src/ittnotify/ittnotify_types.h
32 )
33 set(ITT_SRCS
34     src/ittnotify/ittnotify_static.c
35     src/ittnotify/jitprofiling.c
36 )
37
38 add_library(${ITT_LIBRARY} STATIC ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
39
40 if(NOT WIN32)
41   if(HAVE_DL_LIBRARY)
42     target_link_libraries(${ITT_LIBRARY} dl)
43   endif()
44 endif()
45
46 set_target_properties(${ITT_LIBRARY} PROPERTIES
47         OUTPUT_NAME ${ITT_LIBRARY}
48         DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
49         COMPILE_PDB_NAME ${ITT_LIBRARY}
50         COMPILE_PDB_NAME_DEBUG "${ITT_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
51         ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
52     )
53
54 ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wsign-compare)
55
56 if(ENABLE_SOLUTION_FOLDERS)
57   set_target_properties(${ITT_LIBRARY} PROPERTIES FOLDER "3rdparty")
58 endif()
59
60 if(NOT BUILD_SHARED_LIBS)
61   ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
62 endif()