-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
217 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
!py-build-cmake.local.toml | ||
!py-build-cmake.local.pbc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
cmake_minimum_required(VERSION 3.17) | ||
project(local-options) | ||
|
||
if (NOT DEFINED CACHE{OPTION_A} OR NOT OPTION_A STREQUAL "foo-bar-local-toml") | ||
message(SEND_ERROR "Failed - OPTION_A=\"${OPTION_A}\"") | ||
else() | ||
list(LENGTH OPTION_A OPTION_A_LEN) | ||
if (NOT OPTION_A_LEN EQUAL 1) | ||
message(SEND_ERROR "Failed - OPTION_A_LEN=${OPTION_A_LEN}") | ||
endif() | ||
get_property(OPTION_A_TYPE CACHE OPTION_A PROPERTY TYPE) | ||
if (NOT OPTION_A_TYPE STREQUAL "UNINITIALIZED") | ||
message(SEND_ERROR "Failed - OPTION_A_TYPE=${OPTION_A_TYPE}") | ||
endif() | ||
endif() | ||
|
||
if (NOT DEFINED CACHE{OPTION_B} OR NOT OPTION_B STREQUAL "baz\;local") | ||
message(SEND_ERROR "Failed - OPTION_B=\"${OPTION_B}\"") | ||
else() | ||
list(LENGTH OPTION_B OPTION_B_LEN) | ||
if (NOT OPTION_B_LEN EQUAL 1) | ||
message(SEND_ERROR "Failed - OPTION_B_LEN=${OPTION_B_LEN}") | ||
endif() | ||
get_property(OPTION_B_TYPE CACHE OPTION_B PROPERTY TYPE) | ||
if (NOT OPTION_B_TYPE STREQUAL "UNINITIALIZED") | ||
message(SEND_ERROR "Failed - OPTION_B_TYPE=${OPTION_B_TYPE}") | ||
endif() | ||
endif() | ||
|
||
if (NOT DEFINED CACHE{OPTION_C} OR NOT OPTION_C STREQUAL "foo;bar;local-toml;local-pbc") | ||
message(SEND_ERROR "Failed - OPTION_C=\"${OPTION_C}\"") | ||
else() | ||
list(LENGTH OPTION_C OPTION_C_LEN) | ||
if (NOT OPTION_C_LEN EQUAL 4) | ||
message(SEND_ERROR "Failed - OPTION_C_LEN=${OPTION_C_LEN}") | ||
endif() | ||
get_property(OPTION_C_TYPE CACHE OPTION_C PROPERTY TYPE) | ||
if (NOT OPTION_C_TYPE STREQUAL "UNINITIALIZED") | ||
message(SEND_ERROR "Failed - OPTION_C_TYPE=${OPTION_C_TYPE}") | ||
endif() | ||
endif() | ||
|
||
if (NOT DEFINED CACHE{OPTION_D} OR NOT OPTION_D) | ||
message(SEND_ERROR "Failed - OPTION_D=\"${OPTION_D}\"") | ||
else() | ||
list(LENGTH OPTION_D OPTION_D_LEN) | ||
if (NOT OPTION_D_LEN EQUAL 1) | ||
message(SEND_ERROR "Failed - OPTION_D_LEN=${OPTION_D_LEN}") | ||
endif() | ||
get_property(OPTION_D_TYPE CACHE OPTION_D PROPERTY TYPE) | ||
if (NOT OPTION_D_TYPE STREQUAL "BOOL") | ||
message(SEND_ERROR "Failed - OPTION_D_TYPE=${OPTION_D_TYPE}") | ||
endif() | ||
endif() | ||
|
||
if (NOT DEFINED CACHE{OPTION_E} OR NOT OPTION_E STREQUAL "/usr/bin/local-toml") | ||
message(SEND_ERROR "Failed - OPTION_E=\"${OPTION_E}\"") | ||
else() | ||
list(LENGTH OPTION_E OPTION_E_LEN) | ||
if (NOT OPTION_E_LEN EQUAL 1) | ||
message(SEND_ERROR "Failed - OPTION_E_LEN=${OPTION_E_LEN}") | ||
endif() | ||
get_property(OPTION_E_TYPE CACHE OPTION_E PROPERTY TYPE) | ||
if (NOT OPTION_E_TYPE STREQUAL "FILEPATH") | ||
message(SEND_ERROR "Failed - OPTION_E_TYPE=${OPTION_E_TYPE}") | ||
endif() | ||
endif() | ||
|
||
if (LINUX) | ||
set(OPTION_F_CMP "/some/linux/specific/path/local" "/usr/some/path") | ||
elseif(WIN32) | ||
set(OPTION_F_CMP "/some/windows/specific/path/local" "/usr/some/path") | ||
elseif(APPLE) | ||
set(OPTION_F_CMP "/some/macos/specific/path/local" "/usr/some/path") | ||
else() | ||
set(OPTION_F_CMP "/usr/some/path") | ||
endif() | ||
if (NOT DEFINED CACHE{OPTION_F} OR NOT OPTION_F STREQUAL OPTION_F_CMP) | ||
message(SEND_ERROR "Failed - OPTION_F=\"${OPTION_F}\"") | ||
else() | ||
list(LENGTH OPTION_F OPTION_F_LEN) | ||
list(LENGTH OPTION_F_CMP OPTION_F_CMP_LEN) | ||
if (NOT OPTION_F_LEN EQUAL OPTION_F_CMP_LEN) | ||
message(SEND_ERROR "Failed - OPTION_F_LEN=${OPTION_F_LEN}") | ||
endif() | ||
get_property(OPTION_F_TYPE CACHE OPTION_F PROPERTY TYPE) | ||
if (NOT OPTION_F_TYPE STREQUAL "UNINITIALIZED") | ||
message(SEND_ERROR "Failed - OPTION_F_TYPE=${OPTION_F_TYPE}") | ||
endif() | ||
endif() | ||
|
||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "# Empty") | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" | ||
DESTINATION "${PY_BUILD_CMAKE_MODULE_NAME}") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Local options | ||
|
||
Checks loading of local override files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake.options.OPTION_C+=local-pbc | ||
cmake.options.OPTION_D=True | ||
cmake.options.OPTION_E-=/usr/bin/bash | ||
linux.cmake.options.OPTION_F=/some/linux/specific/path/local | ||
windows.cmake.options.OPTION_F=/some/windows/specific/path/local | ||
mac.cmake.options.OPTION_F=/some/macos/specific/path/local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[cmake.options] | ||
OPTION_A = "foo-bar-local-toml" | ||
OPTION_B = "baz;local" | ||
OPTION_C = {"append" = "local-toml"} | ||
OPTION_E = {"append" = "/usr/bin/local-toml"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[project] | ||
name = "local_options" | ||
version = "0.2.0a15.dev0" | ||
description = "Checks loading of local override files" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
license = { "file" = "LICENSE" } | ||
authors = [{ "name" = "Pieter P", "email" = "[email protected]" }] | ||
keywords = ["example"] | ||
classifiers = [] | ||
urls = { "Documentation" = "https://tttapa.github.io/" } | ||
dependencies = [] | ||
|
||
[build-system] | ||
requires = ["py-build-cmake~=0.2.0a15.dev0"] | ||
build-backend = "py_build_cmake.build" | ||
|
||
[tool.py-build-cmake.sdist] | ||
include = ["CMakeLists.txt"] | ||
|
||
[tool.py-build-cmake.module] | ||
generated = "package" | ||
|
||
[tool.py-build-cmake.cmake] | ||
minimum_version = "3.17" | ||
[tool.py-build-cmake.cmake.options] | ||
OPTION_A = "foo-bar" | ||
OPTION_B = "foo;bar" | ||
OPTION_C = ["foo", "bar"] | ||
OPTION_D = false | ||
OPTION_E = {"value" = "/usr/bin/bash", "type" = "FILEPATH"} | ||
OPTION_F = "/usr/some/path" | ||
|
||
[tool.py-build-cmake.linux.cmake.options] | ||
OPTION_F = {"prepend" = "/some/linux/specific/path"} | ||
[tool.py-build-cmake.windows.cmake.options] | ||
OPTION_F = {"prepend" = "/some/windows/specific/path"} | ||
[tool.py-build-cmake.mac.cmake.options] | ||
OPTION_F = {"prepend" = "/some/macos/specific/path"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def test_placeholder(): | ||
import local_options # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cmake_options-{{version}}/CMakeLists.txt | ||
cmake_options-{{version}}/LICENSE | ||
cmake_options-{{version}}/PKG-INFO | ||
cmake_options-{{version}}/README.md | ||
cmake_options-{{version}}/pyproject.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_options-{{version}}.dist-info/LICENSE | ||
cmake_options-{{version}}.dist-info/METADATA | ||
cmake_options-{{version}}.dist-info/RECORD | ||
cmake_options-{{version}}.dist-info/WHEEL | ||
cmake_options-{{version}}.dist-info/entry_points.txt | ||
cmake_options/__init__.py |