CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #######################################
  2. # Add test subdirectories #
  3. #######################################
  4. #######################################
  5. # Add test includes #
  6. #######################################
  7. add_test_includes()
  8. ###################################################
  9. # Copy custom test output file to binary location #
  10. ###################################################
  11. #configure_file( CTestCustom.cmake ${PROJECT_BINARY_DIR}/CTestCustom.cmake )
  12. add_subdirectory( cip )
  13. add_subdirectory( ports )
  14. add_subdirectory( enet_encap )
  15. add_subdirectory( utils )
  16. add_executable( OpENer_Tests OpENerTests.cpp )
  17. find_library ( CPPUTEST_LIBRARY CppUTest ${CPPUTEST_HOME}/cpputest_build/lib )
  18. find_library ( CPPUTESTEXT_LIBRARY CppUTestExt ${CPPUTEST_HOME}/cpputest_build/lib )
  19. target_link_libraries( OpENer_Tests CIP ENET_ENCAP PLATFORM_GENERIC SAMPLE_APP ${OpENer_PLATFORM}PLATFORM rt )
  20. target_link_libraries( OpENer_Tests gcov ${CPPUTEST_LIBRARY} ${CPPUTESTEXT_LIBRARY} )
  21. target_link_libraries( OpENer_Tests UtilsTest Utils )
  22. target_link_libraries( OpENer_Tests EthernetEncapsulationTest ENET_ENCAP )
  23. target_link_libraries( OpENer_Tests CipTest CIP )
  24. target_link_libraries( OpENer_Tests PortsTest PLATFORM_GENERIC )
  25. ########################################
  26. # Adds test to CTest environment #
  27. ########################################
  28. add_test(OpENer_Tests ${EXECUTABLE_OUTPUT_PATH}/OpENer_Tests -v -c)