Skip to content

Commit

Permalink
fix kinesisvideo-encoder-common tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yt committed Aug 31, 2023
1 parent eafc9e2 commit d7a7767
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions kinesisvideo-encoder-common/h264_encoder_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_package(aws_common REQUIRED)
#############

# add the publisher example
add_library(${PROJECT_NAME} SHARED
add_library(${PROJECT_NAME} STATIC
src/h264_encoder.cpp
src/h264_encoder_node_config.cpp
)
Expand All @@ -37,26 +37,26 @@ target_link_libraries(${PROJECT_NAME}

## Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}-targets"
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
EXPORT "${PROJECT_NAME}-targets"
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

## Mark cpp header files for installation
install(
DIRECTORY include/
DESTINATION include
DIRECTORY include/
DESTINATION include
)

export(TARGETS ${PROJECT_NAME}
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
export(PACKAGE ${PROJECT_NAME})

CONFIGURE_FILE(commonConfig.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY)
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY)
CONFIGURE_FILE(commonConfigVersion.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @ONLY)
${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @ONLY)

INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake DESTINATION share/${PROJECT_NAME}/cmake)
INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION share/${PROJECT_NAME}/cmake)
Expand All @@ -68,19 +68,19 @@ INSTALL(EXPORT ${PROJECT_NAME}-targets DESTINATION share/${PROJECT_NAME}/cmake)
#############

enable_testing()
find_common_test_packages()
add_common_gtest(test_h264_encoder_core
test/h264_encoder_test.cpp
find_package(GTest QUIET)
if(NOT GTEST_FOUND)
message(WARNING "Could not find GTest. Not building unit tests.")
else()
add_executable(test_h264_encoder_core test/h264_encoder_test.cpp)
target_include_directories(test_h264_encoder_core
PRIVATE include
PRIVATE ${aws_common_INCLUDE_DIRS})
target_link_libraries(test_h264_encoder_core
${GTEST_LIBRARIES}
pthread
${aws_common_LIBRARIES}
${PROJECT_NAME}
)
if(TARGET test_h264_encoder_core)
target_include_directories(test_h264_encoder_core PRIVATE
include
${aws_common_INCLUDE_DIRS}
)
target_link_libraries(test_h264_encoder_core
${PROJECT_NAME}
${aws_common_LIBRARIES}
${GMOCK_LIBRARY}
pthread
)
endif()
add_test(NAME test_h264_encoder_core COMMAND test_h264_encoder_core --gtest_output=xml:test_results/)
endif()

0 comments on commit d7a7767

Please sign in to comment.