Skip to content

Commit

Permalink
Simplify examples/minima-program, use a single CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Dec 10, 2024
1 parent 6452123 commit 5f20a05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
13 changes: 9 additions & 4 deletions examples/minimal-program/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
cmake_minimum_required(VERSION 3.15)
project(minimal-program-dev)
project(minimal-program)

# You can add development-specific options here, such as warnings, tests,
# coverage, etc.
# Add the executable to compile
add_executable(minimal_program "src/minimal_program.cpp")

add_subdirectory(src)
# Install the executable
install(TARGETS minimal_program
EXCLUDE_FROM_ALL
COMPONENT python_binaries
RUNTIME DESTINATION ${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.data/scripts
LIBRARY DESTINATION ${PY_BUILD_CMAKE_PACKAGE_NAME}-${PY_BUILD_CMAKE_PACKAGE_VERSION}.data/platlib)
2 changes: 1 addition & 1 deletion examples/minimal-program/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ include = ["CMakeLists.txt", "src/*"]
[tool.py-build-cmake.cmake]
minimum_version = "3.15"
build_type = "RelWithDebInfo"
source_path = "src"
source_path = "."
build_args = ["-j"]
install_components = ["python_binaries"]
find_python = false
Expand Down
12 changes: 0 additions & 12 deletions examples/minimal-program/src/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/expected_contents/minimal-program/sdist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ minimal_program-{{version}}/PKG-INFO
minimal_program-{{version}}/README.md
minimal_program-{{version}}/pyproject.toml
minimal_program-{{version}}/src-python/minimal_program_module/__init__.py
minimal_program-{{version}}/src/CMakeLists.txt
minimal_program-{{version}}/src/minimal_program.cpp

0 comments on commit 5f20a05

Please sign in to comment.