diff --git a/pyproject.toml b/pyproject.toml index f8d1ca18ef..18f10c63ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,13 +39,8 @@ Issues = "https://github.com/AcademySoftwareFoundation/OpenImageIO/issues" [project.scripts] # Use the convention below to expose CLI tools as Python scripts. -iconvert = "OpenImageIO:_command_line" -idiff = "OpenImageIO:_command_line" -igrep = "OpenImageIO:_command_line" -iinfo = "OpenImageIO:_command_line" maketx = "OpenImageIO:_command_line" oiiotool = "OpenImageIO:_command_line" -testtex = "OpenImageIO:_command_line" [build-system] build-backend = "scikit_build_core.build" @@ -65,6 +60,8 @@ cmake.version = "CMakeLists.txt" wheel.license-files = ["LICENSE.md", "THIRD-PARTY.md"] # Make sure the package is structured as expected. wheel.install-dir = "OpenImageIO" +# Only install the user and fonts components. +install.components = ["user", "fonts"] [tool.scikit-build.cmake.define] # Build missing dependencies. See src/cmake for details. @@ -97,23 +94,6 @@ if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" -# Provide CMAKE_PREFIX_PATH hint for downstream scikit-build-based projets -# See https://scikit-build-core.readthedocs.io/en/latest/cmakelists.html#finding-other-packages -[project.entry-points."cmake.prefix"] -any = "OpenImageIO.lib.cmake.OpenImageIO" - -# Touch a few __init__.py files so the above entry-point is recognized. -[[tool.scikit-build.generate]] -path = "OpenImageIO/lib/__init__.py" -template = " " - -[[tool.scikit-build.generate]] -path = "OpenImageIO/lib/cmake/__init__.py" -template = " " - -[[tool.scikit-build.generate]] -path = "OpenImageIO/lib/cmake/OpenImageIO/__init__.py" -template = " " [tool.cibuildwheel] build-verbosity = 1 diff --git a/src/cmake/dependency_utils.cmake b/src/cmake/dependency_utils.cmake index bbb7eaca8a..a30ddff47d 100644 --- a/src/cmake/dependency_utils.cmake +++ b/src/cmake/dependency_utils.cmake @@ -670,7 +670,7 @@ macro (install_local_dependency_libs pkgname libname) "${${pkgname}_LOCAL_INSTALL_DIR}/lib/*${libname}*" "${${pkgname}_LOCAL_INSTALL_DIR}/lib/${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}/*${libname}*" ) - install (FILES ${_lib_files} TYPE LIB) + install (FILES ${_lib_files} TYPE LIB COMPONENT user) # message("${pkgname}_LOCAL_INSTALL_DIR = ${${pkgname}_LOCAL_INSTALL_DIR}") # message(" lib files = ${_lib_files}") if (WIN32) @@ -680,7 +680,7 @@ macro (install_local_dependency_libs pkgname libname) "${${pkgname}_LOCAL_INSTALL_DIR}/bin/${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}/*${libname}*.dll" ) # message(" dll files = ${_lib_files}") - install (FILES ${_lib_files} TYPE BIN) + install (FILES ${_lib_files} TYPE BIN COMPONENT user) endif () unset (_lib_files) endmacro () diff --git a/src/cmake/pythonutils.cmake b/src/cmake/pythonutils.cmake index 12907c8ae5..33c1584f54 100644 --- a/src/cmake/pythonutils.cmake +++ b/src/cmake/pythonutils.cmake @@ -156,7 +156,7 @@ macro (setup_python_module) RUNTIME DESTINATION ${PYTHON_SITE_DIR} COMPONENT user LIBRARY DESTINATION ${PYTHON_SITE_DIR} COMPONENT user) - install(FILES __init__.py DESTINATION ${PYTHON_SITE_DIR}) + install(FILES __init__.py DESTINATION ${PYTHON_SITE_DIR} COMPONENT user) endmacro () diff --git a/src/iconvert/CMakeLists.txt b/src/iconvert/CMakeLists.txt index 735b88def5..89b1d7da3d 100644 --- a/src/iconvert/CMakeLists.txt +++ b/src/iconvert/CMakeLists.txt @@ -2,4 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # https://github.com/AcademySoftwareFoundation/OpenImageIO -fancy_add_executable (LINK_LIBRARIES OpenImageIO) +# Don't build if installing as a Python wheel +if (SKBUILD) + return () +endif () + +fancy_add_executable (LINK_LIBRARIES OpenImageIO) \ No newline at end of file diff --git a/src/idiff/CMakeLists.txt b/src/idiff/CMakeLists.txt index 735b88def5..89b1d7da3d 100644 --- a/src/idiff/CMakeLists.txt +++ b/src/idiff/CMakeLists.txt @@ -2,4 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # https://github.com/AcademySoftwareFoundation/OpenImageIO -fancy_add_executable (LINK_LIBRARIES OpenImageIO) +# Don't build if installing as a Python wheel +if (SKBUILD) + return () +endif () + +fancy_add_executable (LINK_LIBRARIES OpenImageIO) \ No newline at end of file diff --git a/src/igrep/CMakeLists.txt b/src/igrep/CMakeLists.txt index 735b88def5..bb909597b2 100644 --- a/src/igrep/CMakeLists.txt +++ b/src/igrep/CMakeLists.txt @@ -2,4 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # https://github.com/AcademySoftwareFoundation/OpenImageIO +# Don't build if installing as a Python wheel +if (SKBUILD) + return () +endif () + fancy_add_executable (LINK_LIBRARIES OpenImageIO) diff --git a/src/iinfo/CMakeLists.txt b/src/iinfo/CMakeLists.txt index 735b88def5..bb909597b2 100644 --- a/src/iinfo/CMakeLists.txt +++ b/src/iinfo/CMakeLists.txt @@ -2,4 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # https://github.com/AcademySoftwareFoundation/OpenImageIO +# Don't build if installing as a Python wheel +if (SKBUILD) + return () +endif () + fancy_add_executable (LINK_LIBRARIES OpenImageIO) diff --git a/src/iv/CMakeLists.txt b/src/iv/CMakeLists.txt index 30b2fa6bd7..4063e32b97 100644 --- a/src/iv/CMakeLists.txt +++ b/src/iv/CMakeLists.txt @@ -4,6 +4,12 @@ set (OIIO_IV_EXTRA_IV_LIBRARIES "" CACHE STRING "Paths to extra libraries to force iv to link against") + +# Don't build if installing as a Python wheel +if (SKBUILD) + return () +endif () + set (CMAKE_AUTOMOC ON) set (CMAKE_AUTOMOC_PATH_PREFIX OFF) if (Qt5_POSITION_INDEPENDENT_CODE OR Qt6_POSITION_INDEPENDENT_CODE) diff --git a/src/testtex/CMakeLists.txt b/src/testtex/CMakeLists.txt index 5cecb6ce79..89d111dcd3 100644 --- a/src/testtex/CMakeLists.txt +++ b/src/testtex/CMakeLists.txt @@ -8,6 +8,10 @@ # be local to this directory and not override properly by command line `-D`.) set (ENABLE_INSTALL_testtex OFF PARENT_SCOPE) +if (SKBUILD) + return () +endif () + fancy_add_executable (NAME testtex INCLUDE_DIRS ${ROBINMAP_INCLUDES} LINK_LIBRARIES OpenImageIO )