2022-04-28 11:13:20 +00:00
|
|
|
file( GLOB TEST_SOURCES "*.c" )
|
|
|
|
|
|
|
|
# ToDo: fix the tests
|
|
|
|
list(REMOVE_ITEM TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/inter_recon_bipred_tests.c")
|
|
|
|
|
|
|
|
add_executable(uvg266_tests ${TEST_SOURCES} )
|
|
|
|
|
|
|
|
target_include_directories(uvg266_tests PUBLIC ${PROJECT_SOURCE_DIR})
|
|
|
|
target_include_directories(uvg266_tests PUBLIC ${PROJECT_SOURCE_DIR}/src)
|
|
|
|
target_include_directories(uvg266_tests PUBLIC ${PROJECT_SOURCE_DIR}/src/extras)
|
|
|
|
|
2022-04-29 07:49:17 +00:00
|
|
|
add_definitions(-DUVG_DLL_EXPORTS)
|
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DPIC)
|
2022-04-28 11:13:20 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
2022-04-29 07:49:17 +00:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
message(INFO " tests do not work with shared lib at the moment")
|
|
|
|
endif()
|
2022-04-28 11:13:20 +00:00
|
|
|
target_include_directories(uvg266_tests PUBLIC ../src/threadwrapper/include)
|
|
|
|
|
|
|
|
set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" )
|
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -DWIN64)
|
|
|
|
else()
|
2022-04-28 12:32:26 +00:00
|
|
|
set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" )
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
target_link_libraries(uvg266_tests PUBLIC Threads::Threads)
|
|
|
|
|
|
|
|
include(CheckLibraryExists)
|
|
|
|
|
|
|
|
CHECK_LIBRARY_EXISTS(m sin "" HAVE_LIB_M)
|
|
|
|
|
|
|
|
if (HAVE_LIB_M)
|
|
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} m)
|
|
|
|
endif (HAVE_LIB_M)
|
|
|
|
|
|
|
|
target_link_libraries(uvg266_tests PUBLIC ${EXTRA_LIBS})
|
2022-04-28 11:13:20 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_definitions(-DCOMPILE_INTEL)
|
|
|
|
|
2022-04-28 13:38:56 +00:00
|
|
|
target_link_libraries(uvg266_tests PUBLIC uvg266)
|
2022-04-28 11:13:20 +00:00
|
|
|
|