# http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindCxxTest.cmake?root=CMake&view=markup find_package(CxxTest) if(CXXTEST_FOUND) include_directories(${CXXTEST_INCLUDE_DIR}) enable_testing() CXXTEST_ADD_TEST(testCxxApi apitest_cxxtest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/apitest_cxxtest.h ) # target_link_libraries(unittest_foo foo) # as needed install (TARGETS testCxxApi DESTINATION test) file(COPY testdata DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # run test at every build #add_custom_command(TARGET testCxxApi POST_BUILD # COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testCxxApi) add_custom_target(run_testCxxApi COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testCxxApi DEPENDS testCxxApi) include_directories("${PROJECT_SOURCE_DIR}/src/chunkfile/chunkfile") CXXTEST_ADD_TEST(testVecCon VecConTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/VecConTest.h ) target_link_libraries(testVecCon csim) # as needed install (TARGETS testVecCon DESTINATION test) add_custom_command(TARGET testVecCon POST_BUILD COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testVecCon) CXXTEST_ADD_TEST(testLayer_iaf_psc_exp testLayer_iaf_psc_exp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/testLayer_iaf_psc_exp.h ) target_link_libraries(testLayer_iaf_psc_exp csim) # as needed install (TARGETS testLayer_iaf_psc_exp DESTINATION test) add_custom_command(TARGET testLayer_iaf_psc_exp POST_BUILD COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testLayer_iaf_psc_exp) endif()