Skip to content

Commit

Permalink
adding message to cmake and check for existance
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadRaziei committed Nov 10, 2023
1 parent 04186ba commit 39c4fe6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ project(liburlparser LANGUAGES CXX)
# Download the public suffix list file from the internet
set(PUBLIC_SUFFIX_LIST_URL "https://publicsuffix.org/list/public_suffix_list.dat")
set(PUBLIC_SUFFIX_LIST_DAT "public_suffix_list.dat")
file(DOWNLOAD ${PUBLIC_SUFFIX_LIST_URL} ${PUBLIC_SUFFIX_LIST_DAT})

if(EXISTS "${PUBLIC_SUFFIX_LIST_DAT}")
message(STATUS "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is found.")
else()
message(STATUS "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is not found. Trying to download it.")
file(DOWNLOAD "${PUBLIC_SUFFIX_LIST_URL}" ${PUBLIC_SUFFIX_LIST_DAT})
message(STATUS "[DATA] ${PUBLIC_SUFFIX_LIST_DAT} is downloaded.")
endif()

file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)

Expand Down Expand Up @@ -102,7 +109,7 @@ if(DEFINED SKBUILD)
CONFIGURATIONS Release
LIBRARY DESTINATION
${SKBUILD_PROJECT_NAME})
install (FILES public_suffix_list.dat
install (FILES ${PUBLIC_SUFFIX_LIST_DAT}
DESTINATION ${SKBUILD_PROJECT_NAME})

RETURN()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test-skip = ["*universal2:arm64"]

[tool.scikit-build]
#wheel.expand-macos-universal-tags = true
cmake.verbose = false
cmake.verbose = true


[tool.pytest.ini_options]
Expand Down

0 comments on commit 39c4fe6

Please sign in to comment.