Initial cmake conversion of the libt2n project except the example projects. The unit...
[libt2n] / src / CMakeLists.txt
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..936635c
--- /dev/null
@@ -0,0 +1,45 @@
+# Sources
+set(libt2n_SOURCES
+    client.cpp
+    client_wrapper.cpp
+    command.cpp
+    command_client.cpp
+    command_server.cpp
+    connection.cpp
+    container.cpp
+    server.cpp
+    socket_client.cpp
+    socket_handler.cpp
+    socket_server.cpp
+    socket_wrapper.cpp
+    t2n_exception.cpp
+)
+set(libt2n_HEADERS 
+    client.hxx
+    client_wrapper.hxx
+    command.hxx
+    command_client.hxx
+    command_server.hxx
+    connection.hxx
+    container.hxx
+    log.hxx
+    server.hxx
+    socket_client.hxx
+    socket_handler.hxx
+    socket_server.hxx
+    socket_wrapper.hxx
+    t2n_exception.hxx
+    types.hxx
+    container.tcc
+    t2n_exception.tcc
+)
+include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
+
+# Libraries
+add_library(libt2n SHARED ${libt2n_SOURCES} ${libt2n_HEADERS})
+set_target_properties(libt2n PROPERTIES VERSION ${VERSION} SOVERSION 0)
+set_target_properties(libt2n PROPERTIES OUTPUT_NAME t2n)
+
+# Installation
+install(TARGETS libt2n LIBRARY DESTINATION lib)
+install(FILES ${libt2n_HEADERS} DESTINATION include)