add_definitions( -DDATA_DIR_STRING=\"${CMAKE_BINARY_DIR}/test/data\" ) # compiler: creates the binaries add_executable(test_dns ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp ${CMAKE_SOURCE_DIR}/src/host/pinger.cpp ${CMAKE_SOURCE_DIR}/src/dns/hostaddress.cpp ${CMAKE_SOURCE_DIR}/src/dns/timetolive.cpp ${CMAKE_SOURCE_DIR}/src/dns/dnsipprotocol.cpp ${CMAKE_SOURCE_DIR}/src/dns/dnsmaster.cpp ${CMAKE_SOURCE_DIR}/src/dns/dnscache.cpp ${CMAKE_SOURCE_DIR}/src/dns/resolverbase.cpp ${CMAKE_SOURCE_DIR}/src/dns/dnsresolver.cpp test_dns.cpp ) set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED OFF) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.44 COMPONENTS serialization date_time REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) # package: boost-net-dns include_directories(${CMAKE_SOURCE_DIR}/lib/boost-net-dns) # linker: link the program against the libraries target_link_libraries( test_dns ${I2NCOMMON_LIBRARIES} Boost::unit_test_framework Boost::system Boost::program_options Boost::date_time Boost::serialization pthread ) # cmake: invocation via "make test" add_test(test_dns test_dns) # add data subdir for test data # not necessary since is already added by test_icmppacket # and if both add it, we get warnings from cmake #add_subdirectory(data)