CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindCxxTest.cmake?root=CMake&view=markup
  2. find_package(CxxTest)
  3. if(CXXTEST_FOUND)
  4. include_directories(${CXXTEST_INCLUDE_DIR})
  5. enable_testing()
  6. CXXTEST_ADD_TEST(testCxxApi apitest_cxxtest.cpp
  7. ${CMAKE_CURRENT_SOURCE_DIR}/apitest_cxxtest.h
  8. )
  9. # target_link_libraries(unittest_foo foo) # as needed
  10. install (TARGETS testCxxApi DESTINATION test)
  11. file(COPY testdata DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  12. # run test at every build
  13. #add_custom_command(TARGET testCxxApi POST_BUILD
  14. # COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testCxxApi)
  15. add_custom_target(run_testCxxApi
  16. COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testCxxApi
  17. DEPENDS testCxxApi)
  18. include_directories("${PROJECT_SOURCE_DIR}/src/chunkfile/chunkfile")
  19. CXXTEST_ADD_TEST(testVecCon VecConTest.cpp
  20. ${CMAKE_CURRENT_SOURCE_DIR}/VecConTest.h
  21. )
  22. target_link_libraries(testVecCon csim) # as needed
  23. install (TARGETS testVecCon DESTINATION test)
  24. add_custom_command(TARGET testVecCon POST_BUILD
  25. COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testVecCon)
  26. CXXTEST_ADD_TEST(testLayer_iaf_psc_exp testLayer_iaf_psc_exp.cpp
  27. ${CMAKE_CURRENT_SOURCE_DIR}/testLayer_iaf_psc_exp.h
  28. )
  29. target_link_libraries(testLayer_iaf_psc_exp csim) # as needed
  30. install (TARGETS testLayer_iaf_psc_exp DESTINATION test)
  31. add_custom_command(TARGET testLayer_iaf_psc_exp POST_BUILD
  32. COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testLayer_iaf_psc_exp)
  33. endif()