Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enkits] New port #34277

Closed
wants to merge 14 commits into from
50 changes: 50 additions & 0 deletions ports/enkits/fix-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f8572e..8f84548 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)

project( enkiTS )

+include(GNUInstallDirs)
+
option( ENKITS_BUILD_C_INTERFACE "Build C interface" ON )
option( ENKITS_BUILD_EXAMPLES "Build example applications" ON )
option( ENKITS_BUILD_SHARED "Build shared library" OFF )
@@ -9,8 +11,6 @@ option( ENKITS_INSTALL "Generate installation target" OFF )

set( ENKITS_TASK_PRIORITIES_NUM "3" CACHE STRING "Number of task priorities, 1-5, 0 for defined by defaults in source" )

-include_directories( "${PROJECT_SOURCE_DIR}/src" )
-
set( ENKITS_HEADERS
src/LockLessMultiReadPipe.h
src/TaskScheduler.h
@@ -45,6 +45,9 @@ else()
add_library( enkiTS STATIC ${ENKITS_SRC} )
endif()

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

if( ENKITS_TASK_PRIORITIES_NUM GREATER "0" )
target_compile_definitions( enkiTS PUBLIC "ENKITS_TASK_PRIORITIES_NUM=${ENKITS_TASK_PRIORITIES_NUM}" )
@@ -60,8 +63,15 @@ if( UNIX )
endif()

if( ENKITS_INSTALL )
- install(TARGETS enkiTS DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/enkiTS")
- install(FILES ${ENKITS_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/enkiTS")
+ install(
+ TARGETS enkiTS
+ EXPORT enkiTS-config
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${ENKITS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(
+ EXPORT enkiTS-config
+ NAMESPACE enkiTS::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/enkiTS)
endif()
RT2Code marked this conversation as resolved.
Show resolved Hide resolved

if( UNIX )
26 changes: 26 additions & 0 deletions ports/enkits/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't upstream support shared linkage on non-win32?


vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO dougbinks/enkiTS
REF v${VERSION}
SHA512 72a05058caef8d6a33cd70500aeaf05cc61521721697969d4845279b5a79b63e7a6a3f3971c5eff2776e5575720b58252e9d251ef565c2123275a3e8540948db
HEAD_REF master
PATCHES fix-install.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DENKITS_BUILD_C_INTERFACE=OFF
-DENKITS_BUILD_EXAMPLES=OFF
-DENKITS_INSTALL=ON
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
RT2Code marked this conversation as resolved.
Show resolved Hide resolved

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.txt")
19 changes: 19 additions & 0 deletions ports/enkits/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "enkits",
"version": "1.11",
"description": "A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.",
"homepage": "https://github.com/dougbinks/enkiTS",
"license": "Zlib",
"supports": "!android",
"dependencies": [
"imgui",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,10 @@
"baseline": "1.3.17",
"port-version": 2
},
"enkits": {
"baseline": "1.11",
"port-version": 0
},
"ensmallen": {
"baseline": "2.19.1",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/e-/enkits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "67bb817982800a07de32f8da873e16f906ea9686",
"version": "1.11",
"port-version": 0
}
]
}