[med-svn] [Git][med-team/libthread-pool][master] 4 commits: routine-update: New upstream version

Nilesh Patra gitlab at salsa.debian.org
Thu Apr 22 16:49:44 BST 2021



Nilesh Patra pushed to branch master at Debian Med / libthread-pool


Commits:
a2eeab86 by Nilesh Patra at 2021-04-22T21:14:27+05:30
routine-update: New upstream version

- - - - -
f6145268 by Nilesh Patra at 2021-04-22T21:14:28+05:30
New upstream version 3.0.3
- - - - -
bf4b92d0 by Nilesh Patra at 2021-04-22T21:14:28+05:30
Update upstream source from tag 'upstream/3.0.3'

Update to upstream version '3.0.3'
with Debian dir 66a547d24c408ba8ba01c73e3fa0cb10d8390405
- - - - -
1f51183c by Nilesh Patra at 2021-04-22T21:18:04+05:30
Minor fix

- - - - -


6 changed files:

- .travis.yml
- CMakeLists.txt
- + Config.cmake.in
- README.md
- debian/changelog
- debian/control


Changes:

=====================================
.travis.yml
=====================================
@@ -1,46 +1,39 @@
-dist: trusty
-
 language: cpp
 
 matrix:
   include:
-    - name: "GCC 4.8 (Linux)"  # GCC 4.8.5 & CMake 3.9.2
+    - name: "GCC 4.8 (Linux)"  # GCC 4.8.5 & CMake 3.12.4
       os: linux
+      dist: xenial
       addons:
         apt:
           sources:
             - ubuntu-toolchain-r-test
           packages:
             - g++-4.8
-            - cmake
       env:
         - SET_COMPILER="export CC=gcc-4.8 && export CXX=g++-4.8"
 
-    - name: "Clang 3.5 (Linux)"  # Clang 3.5.0 & CMake 3.9.2
+    - name: "Clang 3.5 (Linux)"  # Clang 3.5.2 & CMake 3.12.4
       os: linux
+      dist: xenial
       addons:
         apt:
-          sources:
-            - llvm-toolchain-trusty-3.5
           packages:
             - clang-3.5
-            - cmake
       env:
         - SET_COMPILER="export CC=clang-3.5 && export CXX=clang++-3.5"
 
-    - name: "Clang Xcode 9.0 (OSX)"  # Clang 9.0.0 & CMake 3.9.2
+    - name: "Clang Xcode 9.4 (OSX)"  # Clang 9.4.1 & CMake 3.15.5
       os: osx
-      osx_image: xcode9
+      osx_image: xcode9.4
 
 before_install:
   - eval "${SET_COMPILER}"
-  - git clone https://github.com/google/googletest && cd googletest && mkdir build && cd build && git checkout 703bd9c
-  - cmake -DCMAKE_CXX_FLAGS="-std=c++11" .. && make && sudo make install
-  - cd ../../
 
 install:
   - mkdir build && cd build
-  - cmake -Dthread_pool_build_tests=ON -DCMAKE_BUILD_TYPE=Release .. && make
+  - cmake -DCMAKE_BUILD_TYPE=Release .. && make
 
 script:
   - ./bin/thread_pool_test


=====================================
CMakeLists.txt
=====================================
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.9)
+cmake_minimum_required(VERSION 3.11)
 
-project(thread_pool VERSION 3.0.2
+project(thread_pool VERSION 3.0.3
                     LANGUAGES CXX
                     DESCRIPTION "ThreadPool is a c++ header only library modifying and extending https://github.com/progschj/ThreadPool.")
 
@@ -14,21 +14,80 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
 
+if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
+  set(thread_pool_main_project ON)
+endif ()
+option(thread_pool_install "Generate install target" ${thread_pool_main_project})
+option(thread_pool_build_tests "Build unit tests" ${thread_pool_main_project})
+
 find_package(Threads REQUIRED)
-add_library(${PROJECT_NAME} INTERFACE)
-target_link_libraries(${PROJECT_NAME} INTERFACE
+
+if (thread_pool_build_tests)
+  find_package(GTest 1.10.0 QUIET)
+  if (NOT GTest_FOUND)
+    include(FetchContent)
+
+    FetchContent_Declare(
+      googletest
+      GIT_REPOSITORY https://github.com/google/googletest
+      GIT_TAG release-1.10.0)
+
+    FetchContent_GetProperties(googletest)
+    if (NOT googletest_POPULATED)
+      FetchContent_Populate(googletest)
+      add_subdirectory(
+        ${googletest_SOURCE_DIR}
+        ${googletest_BINARY_DIR}
+        EXCLUDE_FROM_ALL)
+      add_library(GTest::Main ALIAS gtest_main)
+    endif ()
+  endif ()
+endif ()
+
+add_library(thread_pool INTERFACE)
+add_library(${PROJECT_NAME}::thread_pool ALIAS thread_pool)
+
+target_include_directories(thread_pool INTERFACE
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+  $<INSTALL_INTERFACE:include>)
+
+target_link_libraries(thread_pool INTERFACE
   Threads::Threads)
 
-target_include_directories(${PROJECT_NAME} INTERFACE
-  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+if (thread_pool_install)
+  include(GNUInstallDirs)
+  include(CMakePackageConfigHelpers)
+
+  configure_package_config_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+    ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+    INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+  write_basic_package_version_file(
+    ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+    COMPATIBILITY SameMajorVersion)
+
+  install(
+    TARGETS thread_pool
+    EXPORT ${PROJECT_NAME}Targets)
+  install(
+    DIRECTORY include/thread_pool
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+  install(
+    EXPORT ${PROJECT_NAME}Targets
+    NAMESPACE ${PROJECT_NAME}::
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+  install(
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+          ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+endif ()
 
-option(thread_pool_build_tests "Build thread_pool unit tests" OFF)
 if (thread_pool_build_tests)
-  find_package(GTest REQUIRED)
-  add_executable(${PROJECT_NAME}_test
+  add_executable(thread_pool_test
     test/semaphore_test.cpp
     test/thread_pool_test.cpp)
-  target_link_libraries(${PROJECT_NAME}_test
-    ${PROJECT_NAME}
+
+  target_link_libraries(thread_pool_test
+    thread_pool
     GTest::Main)
 endif ()


=====================================
Config.cmake.in
=====================================
@@ -0,0 +1,7 @@
+ at PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+find_dependency(Threads)
+
+include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME at Targets.cmake")
+check_required_components("@PROJECT_NAME@")


=====================================
README.md
=====================================
@@ -7,20 +7,40 @@ ThreadPool is a c++ header only library modifying and extending https://github.c
 
 ## Usage
 
-If you would like to add thread_pool to your project via CMake, add the following:
+To build thread_pool run the following commands:
+```bash
+git clone https://github.com/rvaser/thread_pool && cd thread_pool && mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=Release .. && make
+```
+which will create install targets and unit tests. Running `make install` will create a package on your system that can be searched and linked with:
+```cmake
+find_package(thread_pool)
+target_link_libraries(<target> thread_pool:thread_pool)
+```
+On the other hand, you can include thread_pool as a submodule and add it to your project with the following:
 ```cmake
 if (NOT TARGET thread_pool)
   add_subdirectory(<path_to_submodules>/thread_pool EXCLUDE_FROM_ALL)
 endif ()
-target_link_libraries(<your_exe> thread_pool)
+target_link_libraries(<target> thread_pool::thread_pool)
 ```
 
 If you are not using CMake, include the appropriate header file directly to your project and link with pthread.
 
+#### Build options
+
+- `thread_pool_install`: generate install target
+- `thread_pool_build_tests`: build unit tests
+
 #### Dependencies
 
-- gcc 4.8+ or clang 3.5+
-- (optional) cmake 3.9+
+- gcc 4.8+ | clang 3.5+
+- pthread
+- (optional) cmake 3.11+
+
+###### Hidden
+
+- (thread_pool_test) googletest 1.10.0
 
 ## Examples
 
@@ -38,7 +58,7 @@ auto lambda1 = [...] (...) -> void {
   ...
 };
 
-ThreadPool thread_pool{};
+thread_pool::ThreadPool thread_pool{};
 
 std::vector<std::future<int>> futures;
 for (...) {
@@ -59,20 +79,6 @@ for (const auto& it : void_futures) {
 }
 ```
 
-## Unit tests
-
-To build and run thread_pool unit tests run the following commands:
-
-```bash
-git clone https://github.com/rvaser/thread_pool.git thread_pool
-cd thread_pool && mkdir build && cd build
-cmake -Dthread_pool_build_tests=ON -DCMAKE_BUILD_TYPE=Release .. && make
-./bin/thread_pool_test
-```
-
-#### Dependencies
-- gtest
-
 ## Acknowledgement
 
 This work has been supported in part by the Croatian Science Foundation under the project Single genome and metagenome assembly (IP-2018-01-5886).


=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+libthread-pool (3.0.3-1) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * New upstream version
+
+ -- Nilesh Patra <nilesh at debian.org>  Thu, 22 Apr 2021 21:14:27 +0530
+
 libthread-pool (3.0.2-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -21,6 +21,6 @@ Depends: ${misc:Depends}
 Description: C++ header-only thread pool library (devel)
  A thread pool is a software design pattern for achieving concurrency of
  execution in a computer program. Often also called a replicated workers
- or worker-crew model,[1] a thread pool maintains multiple threads
+ or worker-crew model, a thread pool maintains multiple threads
  waiting for tasks to be allocated for concurrent execution by the
  supervising program.



View it on GitLab: https://salsa.debian.org/med-team/libthread-pool/-/compare/797a99f27912ee47043887ff45679e1bcd38b233...1f51183ccee99f4628b35f4642643a9c7479e0c9

-- 
View it on GitLab: https://salsa.debian.org/med-team/libthread-pool/-/compare/797a99f27912ee47043887ff45679e1bcd38b233...1f51183ccee99f4628b35f4642643a9c7479e0c9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210422/5c55ae44/attachment-0001.htm>


More information about the debian-med-commit mailing list