Initial cmake conversion of the libt2n project except the example projects. The unit...
[libt2n] / test / CMakeLists.txt
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..66f7e7a
--- /dev/null
@@ -0,0 +1,30 @@
+# Sources
+set(test_SOURCES
+    newserver.cpp
+    callback.cpp
+    cmdgroup.cpp
+    comm.cpp
+    hello.cpp
+    reconnect.cpp
+    reentrant.cpp
+    serialize.cpp
+    simplecmd.cpp
+    timeout.cpp
+    wrapper.cpp
+    test_fixtures.hxx
+)
+include_directories(BEFORE
+    ${CMAKE_SOURCE_DIR}/src
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+# Executables
+add_executable(test ${test_SOURCES})
+
+# Dependencies
+target_link_libraries(test libt2n ${Boost_SERIALIZATION_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
+
+# Tests
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS test)
+enable_testing()
+add_test(test test)