From c2c4009ee173850c48546a4f17c561b785b549e4 Mon Sep 17 00:00:00 2001 From: dyz Date: Fri, 24 Jan 2025 01:12:13 +0800 Subject: [PATCH] create project struct --- CMakeLists.txt | 14 ++++++++++++++ bin/.gitkeep | 0 header/.gitkeep | 0 include/.gitkeep | 0 main.cpp | 6 ++++++ test/CMakeLists.txt | 9 +++++++++ test/test.cpp | 0 7 files changed, 29 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 bin/.gitkeep create mode 100644 header/.gitkeep create mode 100644 include/.gitkeep create mode 100644 main.cpp create mode 100644 test/CMakeLists.txt create mode 100644 test/test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..19420ce --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.16) +project(ProcessPool) +set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +add_library(${PROJECT_NAME} SHARED main.cpp) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/header +) + +if (BUILD_TEST) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test) +endif() \ No newline at end of file diff --git a/bin/.gitkeep b/bin/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/header/.gitkeep b/header/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/include/.gitkeep b/include/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..c18d9a4 --- /dev/null +++ b/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "hello ProcessPoll" << '\n'; + return 0; +} \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..447e356 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.16) + +# Add test executable +add_executable(${PROJECT_NAME}_test test.cpp) + +# Link against main library +target_link_libraries(${PROJECT_NAME}_test PRIVATE + ${PROJECT_NAME} +) diff --git a/test/test.cpp b/test/test.cpp new file mode 100644 index 0000000..e69de29