Skip to content

Commit

Permalink
build: fix gemmi-config.cmake and change defaults in pyproject.toml
Browse files Browse the repository at this point in the history
gemmi-config.cmake didn't work if ZLIB was not found

and two unrelated changes:

in CMakeLists.txt, python module is marked as COMPONENT py,
so that it's possible to install only python module with:
cmake --install <dir> --component py

in pyproject.toml, setting BUILD_GEMMI_PROGRAM and INSTALL_DEV_FILES
to OFF was removed, so it's ON by default.
But it's set to off in cibuildwheel configuration.
  • Loading branch information
wojdyr committed Dec 15, 2023
1 parent 228f180 commit 1f11f5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ else()
endif()
set_property(TARGET ungz PROPERTY POSITION_INDEPENDENT_CODE ON)
macro(support_gz exe)
target_sources(${exe} PUBLIC $<TARGET_OBJECTS:ungz>)
target_sources(${exe} PRIVATE $<TARGET_OBJECTS:ungz>)
endmacro()
endif()

Expand Down Expand Up @@ -473,5 +473,5 @@ if (USE_PYTHON)
# Using Python_SITEARCH/SITELIB is not good, because they are absolute
# and don't respect CMAKE_INSTALL_PREFIX.
# https://discourse.cmake.org/t/findpython3-how-to-specify-local-installation-directory-for-python-module/3580/5
install(TARGETS gemmi_py DESTINATION "${Python_SITEARCH}")
install(TARGETS gemmi_py DESTINATION "${Python_SITEARCH}" COMPONENT py)
endif()
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ cmake.build-type = "Release"
cmake.verbose = true
[tool.scikit-build.cmake.define]
USE_PYTHON = "ON"
BUILD_GEMMI_PROGRAM = "OFF"
INSTALL_DEV_FILES = "OFF"

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
Expand Down
2 changes: 1 addition & 1 deletion tools/gemmi-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
find_package(ZLIB)

include("${CMAKE_CURRENT_LIST_DIR}/gemmi-targets.cmake")

Expand Down

0 comments on commit 1f11f5f

Please sign in to comment.