diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4601d46 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.8) + +project(OwlPS) + + +### Build paths ### + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + + +### Libraries ### + +add_subdirectory(libowlps) +include_directories(libowlps) + +add_subdirectory(libowlps-client) +include_directories(libowlps-client) + +add_subdirectory(libowlps-resultreader) +include_directories(libowlps-resultreader) + + +### Programs ### + +add_subdirectory(owlps-aggregator) + +add_subdirectory(owlps-client) + +if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) + add_subdirectory(owlps-listener) +else() + message(WARNING + "OwlPS Listener can be built only for Linux systems") +endif() + +#add_subdirectory(owlps-positioner) + +add_subdirectory(owlps-udp-to-http) diff --git a/TODO.t2t b/TODO.t2t index 59a6f33..c33e26c 100644 --- a/TODO.t2t +++ b/TODO.t2t @@ -55,9 +55,17 @@ Work to do in OwlPS - Add option dump-configuration (displays the config & exits). -- Makefiles: - - Use install instead of cp? - - autotools, cmake? +- CMake: + - handle OwlPS version + - libraries: version numbers (sonames) and symbolic links + - compilation flags + - installation targets + - static targets + - Client: handle ENABLE_RECEIVE_POSITION and link to + libowlps-resultreader when activated + - Listener: handle options (USE_CONFIG_FILE, USE_PTHREAD, + ENABLE_KEEP_MONITOR@ + - compile Positioner - Support string-based positioning requests diff --git a/libowlps-client/CMakeLists.txt b/libowlps-client/CMakeLists.txt new file mode 100644 index 0000000..4e2cb61 --- /dev/null +++ b/libowlps-client/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(libowlps-client.a STATIC libowlps-client.c) +add_library(libowlps-client.so SHARED libowlps-client.c) +set_target_properties( + libowlps-client.a libowlps-client.so + PROPERTIES OUTPUT_NAME owlps-client) diff --git a/libowlps-resultreader/CMakeLists.txt b/libowlps-resultreader/CMakeLists.txt new file mode 100644 index 0000000..b66ccaa --- /dev/null +++ b/libowlps-resultreader/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(libowlps-resultreader.a STATIC libowlps-resultreader.c) +add_library(libowlps-resultreader.so SHARED libowlps-resultreader.c) +set_target_properties( + libowlps-resultreader.a libowlps-resultreader.so + PROPERTIES OUTPUT_NAME owlps-resultreader) + +add_executable(owlps-resultreader-udp owlps-resultreader-udp.c) +target_link_libraries(owlps-resultreader-udp + libowlps.so + libowlps-resultreader.so) + +add_executable(owlps-resultreader-udp.semistatic owlps-resultreader-udp.c) +target_link_libraries(owlps-resultreader-udp.semistatic + libowlps.a + libowlps-resultreader.a) diff --git a/libowlps/CMakeLists.txt b/libowlps/CMakeLists.txt new file mode 100644 index 0000000..7fda6b1 --- /dev/null +++ b/libowlps/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(libowlps.a STATIC libowlps.c) +add_library(libowlps.so SHARED libowlps.c) +set_target_properties( + libowlps.a libowlps.so + PROPERTIES OUTPUT_NAME owlps) diff --git a/owlps-aggregator/CMakeLists.txt b/owlps-aggregator/CMakeLists.txt new file mode 100644 index 0000000..de49f2b --- /dev/null +++ b/owlps-aggregator/CMakeLists.txt @@ -0,0 +1,11 @@ +set(EXTRA_LIBS ${EXTRA_LIBS} pthread confuse) + +add_executable(owlps-aggregatord owlps-aggregatord.c) +target_link_libraries(owlps-aggregatord + libowlps.so + ${EXTRA_LIBS}) + +add_executable(owlps-aggregatord.semistatic owlps-aggregatord.c) +target_link_libraries(owlps-aggregatord.semistatic + libowlps.a + ${EXTRA_LIBS}) diff --git a/owlps-client/CMakeLists.txt b/owlps-client/CMakeLists.txt new file mode 100644 index 0000000..27a9233 --- /dev/null +++ b/owlps-client/CMakeLists.txt @@ -0,0 +1,10 @@ + +add_executable(owlps-client owlps-client.c) +target_link_libraries(owlps-client + libowlps.so + libowlps-client.so) + +add_executable(owlps-client.semistatic owlps-client.c) +target_link_libraries(owlps-client.semistatic + libowlps.a + libowlps-client.a) diff --git a/owlps-listener/CMakeLists.txt b/owlps-listener/CMakeLists.txt new file mode 100644 index 0000000..039d8f0 --- /dev/null +++ b/owlps-listener/CMakeLists.txt @@ -0,0 +1,13 @@ +set(EXTRA_LIBS ${EXTRA_LIBS} pcap) + +add_executable(owlps-listenerd owlps-listenerd.c) +target_link_libraries(owlps-listenerd + libowlps.so + libowlps-client.so + ${EXTRA_LIBS}) + +add_executable(owlps-listenerd.semistatic owlps-listenerd.c) +target_link_libraries(owlps-listenerd.semistatic + libowlps.a + libowlps-client.a + ${EXTRA_LIBS}) diff --git a/owlps-udp-to-http/CMakeLists.txt b/owlps-udp-to-http/CMakeLists.txt new file mode 100644 index 0000000..8cb3857 --- /dev/null +++ b/owlps-udp-to-http/CMakeLists.txt @@ -0,0 +1,13 @@ +set(EXTRA_LIBS ${EXTRA_LIBS} pthread) + +add_executable(owlps-udp-to-http owlps-udp-to-http.c) +target_link_libraries(owlps-udp-to-http + libowlps.so + libowlps-resultreader.so + ${EXTRA_LIBS}) + +add_executable(owlps-udp-to-http.semistatic owlps-udp-to-http.c) +target_link_libraries(owlps-udp-to-http.semistatic + libowlps.a + libowlps-resultreader.a + ${EXTRA_LIBS})