Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install path cmake #189

Merged
merged 10 commits into from
Dec 17, 2024
25 changes: 22 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- windows-2019
- windows-2022
- macos-13 # Uses x64
- macos-14 # Uses Apple Silicon

Expand All @@ -89,6 +89,24 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Setup msbuild on Windows
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2

- name: Setup ninja on Windows
if: runner.os == 'Windows'
uses: ashutoshvarma/[email protected]

- name: Enable developer command prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: install pkgconfig on windows
if: runner.os == 'Windows'
shell: bash
run: |
choco install pkgconfiglite

- name: Install build deps on MacOs
if: runner.os == 'macOs'
run: brew install autoconf automake libtool m4 ninja
Expand All @@ -98,18 +116,19 @@ jobs:
env:
MACOSX_DEPLOYMENT_TARGET: 11.0.0
GITHUB_TOK: "${{ secrets.GITHUB_TOKEN }}"
CMAKE_GENERATOR: "Ninja"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl



publish:

runs-on: ubuntu-latest
needs: [ build_wheels, build_sdist ]
if: ${{ github.event_name == 'push' }}

steps:
- name: Setup Python
uses: actions/setup-python@v5
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: use ninja
shell: bash
run: |
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV

- name: Setup msbuild on Windows
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
Expand Down Expand Up @@ -127,6 +122,7 @@ jobs:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
MACOSX_DEPLOYMENT_TARGET: 11.0.0
VCPKG_FORCE_SYSTEM_BINARIES: 1
CMAKE_GENERATOR: "Ninja"

- name: Build
# Build your program with the given configuration
Expand Down
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ add_subdirectory(streams)

if (ROUGHPY_BUILD_PYLIB)
add_subdirectory(roughpy)


install(TARGETS RoughPy_PyModule
RUNTIME DESTINATION roughpy
LIBRARY
DESTINATION roughpy
NAMELINK_SKIP
ARCHIVE DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
EXCLUDE_FROM_ALL
INCLUDES DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
FRAMEWORK DESTINATION roughpy
EXCLUDE_FROM_ALL
)

install(DIRECTORY roughpy
DESTINATION .
FILES_MATCHING
PATTERN "py.typed"
PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "src/*" EXCLUDE)

endif ()


Expand All @@ -225,6 +249,7 @@ install(TARGETS
RoughPy_Scalars
RoughPy_Algebra
RoughPy_Streams
Libalgebra_lite
EXPORT RoughPy_EXPORTS
RUNTIME DESTINATION roughpy
LIBRARY
Expand Down
23 changes: 0 additions & 23 deletions roughpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,6 @@ configure_file(version.py.in ${CMAKE_CURRENT_LIST_DIR}/version.py @ONLY)



install(TARGETS RoughPy_PyModule
RUNTIME DESTINATION roughpy
LIBRARY
DESTINATION roughpy
NAMELINK_SKIP
ARCHIVE DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
EXCLUDE_FROM_ALL
INCLUDES DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
FRAMEWORK DESTINATION roughpy
EXCLUDE_FROM_ALL
)

install(FILES roughpy/py.typed DESTINATION roughpy)
install(DIRECTORY roughpy
DESTINATION .
FILES_MATCHING
PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "src/*" EXCLUDE)





Expand Down
36 changes: 2 additions & 34 deletions tools/ci/before-all-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,8 @@
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

echo $OSTYPE
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
yum install -y curl zip unzip tar gmp-devel

# manylinux doesn't have mono, we'll have to install it
rpmkeys --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
yum install -y mono-complete

MONO_EXE=mono
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install libomp
MONO_EXE=mono
elif [[ "$OSTYPE" == "msys"* ]]; then
MONO_EXE=""
else
exit 1
fi
git clone https://github.com/Microsoft/vcpkg.git tools/vcpkg
bash tools/vcpkg/bootstrap-vcpkg.sh -disableMetrics

git clone https://github.com/Microsoft/vcpkg.git
bash vcpkg/bootstrap-vcpkg.sh -disableMetrics

vcpkg_root=./vcpkg

#if [ -n "$GITHUB_TOK" ]; then
# # If the token is defined, set up binary caching
# $MONO_EXE `$vcpkg_root/vcpkg fetch nuget | tail -n 1` \
# sources add \
# -source "https://nuget.pkg.github.com/datasig-ac-uk/index.json" \
# -storepasswordincleartext \
# -name "GitHub" \
# -username "datasig-ac-uk" \
# -password "$GITHUB_TOK"
# $MONO_EXE `$vcpkg_root/vcpkg fetch nuget | tail -n 1` \
# setapikey "$GITHUB_TOK" \
# -source "https://nuget.pkg.github.com/datasig-ac-uk/index.json"
#fi
3 changes: 0 additions & 3 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
}, {
"name" : "opencl",
"version>=" : "v2024.05.08"
}, {
"name" : "boost-stacktrace",
"version>=" : "1.83.0"
}, {
"name" : "range-v3",
"version>=" : "0.12.0#4"
Expand Down
Loading