From bb10df2bde04018abcfad8c4ecdd07e75cc20090 Mon Sep 17 00:00:00 2001 From: k-dominik Date: Tue, 5 May 2026 11:02:03 +0200 Subject: [PATCH 1/4] use cmake-package-check on all platforms --- conda-recipe/recipe.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conda-recipe/recipe.yaml b/conda-recipe/recipe.yaml index 344ca33..67395e2 100644 --- a/conda-recipe/recipe.yaml +++ b/conda-recipe/recipe.yaml @@ -57,6 +57,11 @@ outputs: - if: not win then: test -f ${PREFIX}/lib/cmake/dpct/dpctConfigVersion.cmake else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctConfigVersion.cmake exit 1 + - cmake-package-check dpct --targets dpct + requirements: + run: + - cmake-package-check + - package: name: dpct From d384c955b27d979450cc989f18212b4304565925 Mon Sep 17 00:00:00 2001 From: k-dominik Date: Tue, 5 May 2026 11:07:30 +0200 Subject: [PATCH 2/4] Try check via package contents --- conda-recipe/recipe.yaml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/conda-recipe/recipe.yaml b/conda-recipe/recipe.yaml index 67395e2..987693a 100644 --- a/conda-recipe/recipe.yaml +++ b/conda-recipe/recipe.yaml @@ -35,33 +35,19 @@ outputs: - ${{ pin_subpackage("libdpct", exact=True) }} tests: + - package_contents: + include: + - dpct/*.h + lib: + - dpct + - script: - - if: not win - then: test -d ${PREFIX}/include/dpct - else: if not exist %LIBRARY_INC%\dpct exit 1 - - if: osx - then: test -f ${PREFIX}/lib/libdpct.dylib - - if: linux - then: test -f ${PREFIX}/lib/libdpct.so - - if: win - then: if not exist %LIBRARY_BIN%\dpct.dll exit 1 - - if: not win - then: test -f ${PREFIX}/lib/cmake/dpct/dpctTargets.cmake - else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctTargets.cmake exit 1 - - if: not win - then: test -f ${PREFIX}/lib/cmake/dpct/dpctTargets-release.cmake - else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctTargets-release.cmake exit 1 - - if: not win - then: test -f ${PREFIX}/lib/cmake/dpct/dpctConfig.cmake - else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctConfig.cmake exit 1 - - if: not win - then: test -f ${PREFIX}/lib/cmake/dpct/dpctConfigVersion.cmake - else: if not exist %LIBRARY_LIB%\cmake\dpct\dpctConfigVersion.cmake exit 1 - cmake-package-check dpct --targets dpct requirements: run: - cmake-package-check - + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} - package: name: dpct From e58ecc7e0250544c0b363460358bba2879512285 Mon Sep 17 00:00:00 2001 From: k-dominik Date: Wed, 6 May 2026 17:43:34 +0200 Subject: [PATCH 3/4] no need to expose headers in python, add namespace to package --- CMakeLists.txt | 2 ++ conda-recipe/recipe.yaml | 2 +- python/CMakeLists.txt | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1df0f71..ef016c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ else() $ ) + add_library(dpct::dpct ALIAS dpct) set_target_properties(dpct PROPERTIES EXPORT_NAME dpct ) @@ -70,6 +71,7 @@ else() install(EXPORT dpctTargets FILE dpctTargets.cmake DESTINATION lib/cmake/dpct + NAMESPACE dpct:: ) write_basic_package_version_file( diff --git a/conda-recipe/recipe.yaml b/conda-recipe/recipe.yaml index 987693a..45d5acc 100644 --- a/conda-recipe/recipe.yaml +++ b/conda-recipe/recipe.yaml @@ -42,7 +42,7 @@ outputs: - dpct - script: - - cmake-package-check dpct --targets dpct + - cmake-package-check dpct --targets dpct::dpct requirements: run: - cmake-package-check diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 7793e4b..3a85fcd 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,8 +10,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS}) set(PYDPCT_SRCS pydpct.cpp pythongraphreader.cpp) pybind11_add_module(dpct_python ${PYDPCT_SRCS}) set_target_properties(dpct_python PROPERTIES OUTPUT_NAME dpct) -target_link_libraries(dpct_python PRIVATE dpct) -target_include_directories(dpct_python PRIVATE ${DPCT_INCLUDE_DIR}) +target_link_libraries(dpct_python PRIVATE dpct::dpct) install(TARGETS dpct_python LIBRARY DESTINATION ${Python_SITELIB} From bf0517575acf1e80409c19cda1b19b4e52c27680 Mon Sep 17 00:00:00 2001 From: k-dominik Date: Wed, 6 May 2026 18:16:05 +0200 Subject: [PATCH 4/4] Use standard functionality to find lemon (works with the conda package) --- CMakeLists.txt | 6 +++--- cmake/dpctConfig.cmake.in | 2 +- cmake_extensions/FindLemon.cmake | 21 --------------------- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 cmake_extensions/FindLemon.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ef016c5..d21f0e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,14 +35,14 @@ endif() if (MULTI_STAGE_BUILD) find_package(dpct REQUIRED) else() - find_package(Lemon REQUIRED) + find_package(LEMON REQUIRED) find_package(jsoncpp REQUIRED) file(GLOB_RECURSE SOURCES src/*.cpp) file(GLOB_RECURSE HEADERS include/*.h) - include_directories(${Lemon_INCLUDE_DIR}) + include_directories(${LEMON_INCLUDE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/) add_library(dpct SHARED ${SOURCES} ${HEADERS}) - target_link_libraries(dpct ${Lemon_LIBRARIES} JsonCpp::JsonCpp) + target_link_libraries(dpct ${LEMON_LIBRARIES} JsonCpp::JsonCpp) target_include_directories(dpct PUBLIC diff --git a/cmake/dpctConfig.cmake.in b/cmake/dpctConfig.cmake.in index 4c0e97c..f095b11 100644 --- a/cmake/dpctConfig.cmake.in +++ b/cmake/dpctConfig.cmake.in @@ -1,7 +1,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(Lemon REQUIRED) +find_dependency(LEMON REQUIRED) find_dependency(jsoncpp REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/dpctTargets.cmake") diff --git a/cmake_extensions/FindLemon.cmake b/cmake_extensions/FindLemon.cmake deleted file mode 100644 index dedb6b4..0000000 --- a/cmake_extensions/FindLemon.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# This module finds an installed Lemon package. -# -# It sets the following variables: -# Lemon_FOUND - Set to false, or undefined, if lemon isn't found. -# Lemon_INCLUDE_DIR - Lemon include directory. -# Lemon_LIBRARIES - Lemon library files -FIND_PATH(Lemon_INCLUDE_DIR lemon/config.h PATHS /usr/include /usr/local/include ${CMAKE_INCLUDE_PATH} ${CMAKE_PREFIX_PATH}/include $ENV{Lemon_ROOT}/include ENV CPLUS_INCLUDE_PATH) -FIND_LIBRARY(Lemon_LIBRARIES - NAMES emon lemon - PATHS $ENV{Lemon_ROOT}/src/impex $ENV{Lemon_ROOT}/lib ENV LD_LIBRARY_PATH ENV LIBRARY_PATH -) - -GET_FILENAME_COMPONENT(Lemon_LIBRARY_PATH ${Lemon_LIBRARIES} PATH) -SET( Lemon_LIBRARY_DIR ${Lemon_LIBRARY_PATH} CACHE PATH "Path to lemon library.") - -# handle the QUIETLY and REQUIRED arguments and set Lemon_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lemon DEFAULT_MSG Lemon_LIBRARIES Lemon_INCLUDE_DIR) - -MARK_AS_ADVANCED( Lemon_INCLUDE_DIR Lemon_LIBRARIES Lemon_LIBRARY_DIR )