<commit_before>project( libmfx )

# FIXME Adds support for using system/other install of intel media sdk
find_path ( INTELMEDIASDK_PATH mfx/mfxvideo.h
  HINTS "${CMAKE_SOURCE_DIR}"
)

if (INTELMEDIASDK_PATH_NOTFOUND)
  message( FATAL_ERROR "Intel MEDIA SDK include not found" )
else (INTELMEDIASDK_PATH_NOTFOUND)
  message(STATUS "Intel Media SDK is here: ${INTELMEDIASDK_PATH}")
endif (INTELMEDIASDK_PATH_NOTFOUND)


set(SOURCES
  src/main.cpp
  src/mfx_critical_section.cpp
  src/mfx_critical_section_linux.cpp
  src/mfx_dispatcher.cpp
  src/mfx_dispatcher_log.cpp
  src/mfx_dxva2_device.cpp
  src/mfx_function_table.cpp
  src/mfx_library_iterator.cpp
  src/mfx_library_iterator_linux.cpp
  src/mfx_load_dll.cpp
  src/mfx_load_dll_linux.cpp
  src/mfx_win_reg_key.cpp
)

include_directories(
  ${INTELMEDIASDK_PATH}
  ${INTELMEDIASDK_PATH}/mfx
)

add_definitions(
  -DMFX_VA
  -D_LIB
  -fPIC
)

if (CMAKE_SYSTEM_NAME EQUAL 'Windows')
  add_definitions(
    -DWIN32
  )
endif (CMAKE_SYSTEM_NAME EQUAL 'Windows')

configure_file (${CMAKE_SOURCE_DIR}/libmfx.pc.cmake ${CMAKE_BINARY_DIR}/libmfx.pc @ONLY)

add_library( mfx STATIC ${SOURCES} )
file(GLOB MFX_HEADERS "${CMAKE_SOURCE_DIR}/mfx/*.h")
install (FILES ${MFX_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install (FILES ${CMAKE_BINARY_DIR}/libmfx.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
install (TARGETS mfx ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
cmake_minimum_required(VERSION 2.6)<commit_msg>Fix cmake Windows build<commit_after>project( libmfx )

# FIXME Adds support for using system/other install of intel media sdk
find_path ( INTELMEDIASDK_PATH mfx/mfxvideo.h
  HINTS "${CMAKE_SOURCE_DIR}"
)

if (INTELMEDIASDK_PATH_NOTFOUND)
  message( FATAL_ERROR "Intel MEDIA SDK include not found" )
else (INTELMEDIASDK_PATH_NOTFOUND)
  message(STATUS "Intel Media SDK is here: ${INTELMEDIASDK_PATH}")
endif (INTELMEDIASDK_PATH_NOTFOUND)


set(SOURCES
  src/main.cpp
  src/mfx_dispatcher.cpp
  src/mfx_dispatcher_log.cpp
  src/mfx_function_table.cpp
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
  list(APPEND SOURCES
    src/mfx_library_iterator_linux.cpp
    src/mfx_load_dll_linux.cpp
    src/mfx_critical_section_linux.cpp
  )
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")

if (CMAKE_SYSTEM_NAME MATCHES "Windows")
  add_definitions(-DWIN32)
  list(APPEND SOURCES
    src/mfx_critical_section.cpp
    src/mfx_dxva2_device.cpp
    src/mfx_library_iterator.cpp
    src/mfx_load_dll.cpp
    src/mfx_load_plugin.cpp
    src/mfx_plugin_hive.cpp
    src/mfx_win_reg_key.cpp
  )
endif (CMAKE_SYSTEM_NAME MATCHES "Windows")

include_directories(
  ${INTELMEDIASDK_PATH}
  ${INTELMEDIASDK_PATH}/mfx
)

add_definitions(
  -DMFX_VA
  -D_LIB
  -fPIC
)

configure_file (${CMAKE_SOURCE_DIR}/libmfx.pc.cmake ${CMAKE_BINARY_DIR}/libmfx.pc @ONLY)

add_library( mfx STATIC ${SOURCES} )
file(GLOB MFX_HEADERS "${CMAKE_SOURCE_DIR}/mfx/*.h")
install (FILES ${MFX_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install (FILES ${CMAKE_BINARY_DIR}/libmfx.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
install (TARGETS mfx ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
cmake_minimum_required(VERSION 2.6)
{'fraction_non_alphanumeric': 0.09640831758034027, 'fraction_numerical': 0.00315059861373661, 'mean_word_length': 5.740976645435244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7410192', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1278, 'n_words': 211}