diff --git a/CMakeLists.txt b/CMakeLists.txt index 1df0f71..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 @@ -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/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 ) diff --git a/conda-recipe/recipe.yaml b/conda-recipe/recipe.yaml index 344ca33..45d5acc 100644 --- a/conda-recipe/recipe.yaml +++ b/conda-recipe/recipe.yaml @@ -35,28 +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::dpct + requirements: + run: + - cmake-package-check + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} - package: name: dpct 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}