Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbinks committed Jan 28, 2024
2 parents f90164c + 3d6c3f8 commit 7845f41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.0)

project( enkiTS )
project( enkiTS
VERSION "1.11"
DESCRIPTION "A C and C++ task scheduler for creating parallel programs"
HOMEPAGE_URL "https://github.com/dougbinks/enkiTS"
LANGUAGES C CXX)

include(GNUInstallDirs)

Expand Down Expand Up @@ -36,6 +40,9 @@ if( ENKITS_BUILD_SHARED )
add_library( enkiTS SHARED ${ENKITS_SRC} )
target_compile_definitions( enkiTS PRIVATE ENKITS_BUILD_DLL=1 )
target_compile_definitions( enkiTS INTERFACE ENKITS_DLL=1 )
set_target_properties( enkiTS PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
if( UNIX )
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
Expand All @@ -47,7 +54,7 @@ endif()

target_include_directories( enkiTS PUBLIC
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/enkiTS> )

if( ENKITS_TASK_PRIORITIES_NUM GREATER "0" )
target_compile_definitions( enkiTS PUBLIC "ENKITS_TASK_PRIORITIES_NUM=${ENKITS_TASK_PRIORITIES_NUM}" )
Expand All @@ -67,7 +74,7 @@ if( ENKITS_INSTALL )
TARGETS enkiTS
EXPORT enkiTSConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/enkiTS)
install(
EXPORT enkiTSConfig
NAMESPACE enkiTS::
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ For cmake, on Windows / Mac OS X / Linux with cmake installed, open a prompt in
1. *Completion Actions* - can perform an action on task completion. This avoids the expensive action of adding the task to the scheduler, and can be used to safely delete a completed task. See [example/CompletionAction.cpp](example/CompletionAction.cpp) and [example/CompletionAction_c.c](example/CompletionAction_c.c)
1. **NEW** *Can wait for pinned tasks* - Can wait for pinned tasks, useful for creating IO threads which do no other work. See [example/WaitForNewPinnedTasks.cpp](example/WaitForNewPinnedTasks.cpp) and [example/WaitForNewPinnedTasks_c.c](example/WaitForNewPinnedTasks_c.c).

## Installing

I recommend using enkiTS directly from source in each project rather than installing it for system wide use. However enkiTS' cmake script can also be used to install the library
if the `ENKITS_INSTALL` cmake variable is set to `ON` (it defaults to `OFF`).

When installed the header files are installed in a subdirectory of the include path, `include/enkiTS` to ensure that they do not conflict with header files from other packages.
When building applications either ensure this is part of the `INCLUDE_PATH` variable or ensure that enkiTS is in the header path in the source files, for example use `#include "enkiTS/TaskScheduler.h"` instead of `#include "TaskScheduler.h"`.

## Using enkiTS

### C++ usage
Expand Down

0 comments on commit 7845f41

Please sign in to comment.