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

CMAKE : Csharp Build Process working on Win / Mac / Linux #5046

Merged
merged 154 commits into from
Jan 25, 2022

Conversation

runette
Copy link
Contributor

@runette runette commented Dec 27, 2021

What does this PR do?

Fixes the problem with building the C# bindings on Windows.

  • Builds by default using dotnet. If it cannot find dotnet it looks for mono.
  • Adds a compiler switch to allow the use of mono to be forced
  • Compiles by default both libraries and executables when using dotnet to be net5.0 but there are compiler switches to allow other versions to be used.
  • if built using dotnet, adds NuGET packages for the bindings using an OSGeo namespace
  • adds install commands for the xxx_csharp.dlls and the sample binaries
  • adds targets to allow the bindings to be built on an existing installation of GDAL
  • the name of the sample program ogrinfo.exe has been renamed OgrInfo.exe since it appears Cmake does not like having multiple targets with the same name. This is consistent with the other sample binary names and to keep consistency createdata.exe has been renamed CreateData.exe
  • add two extra compile tests for building under Linux with Mono and for building standalone
  • Compiles successfully for Windows (including MSYS2). Linux and MacOS using dotnet and mono (but the mono and windows combination has not been tested)
  • Adds documentation
  • Adds the complete set of tests from the legacy scripts

What are related issues/pull requests?

#4995

Add c# only test

fix test name

fix compile paths

fix the target name

Fix target name mark 2

fix the dependencies

Add samples

change nuget names

change nuget dependencies

fix if

Fix system depends

fix csharp binding target

Fix target names

fix more dependencies

add nuspec to installs

fix versionig

add marker dependencies
Mono fix

Mono Fix

mono fix 3

mon + win

linux fix

fix nupkg

lint
.github/workflows/cmake_builds.yml Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Show resolved Hide resolved
add tests back

remove the mono only build

First Tests added

add test dependencies

Fix missing PROPERTY

fix test dependencies

fix path bug

fix cs typo

test fixes

Fix GDALWarp

mono fix

lint

fix gdal
@runette
Copy link
Contributor Author

runette commented Jan 19, 2022

@rouault -- there seems to be some error in the CI tests that has nothing to do with any subsystem that I have touched and did not happen in my fork using the same test - see https://github.com/OSGeo/gdal/runs/4861157262?check_suite_focus=true. Could this be transient?

Other than that - as far I am concerned this PR is now working. I would propose that it should be merged.

Copy link
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the latest updates. A few remarks below. (I've restarted the failed build. it was a network flake)

swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
swig/csharp/CMakeLists.txt Outdated Show resolved Hide resolved
fixes

change to .exe for test

fix mono path

mono fixes

more fixes
@rouault
Copy link
Member

rouault commented Jan 24, 2022

I confirm the charp mono tests work with stock Ubuntu 20.04. Thanks for all the work on this!

@runette
Copy link
Contributor Author

runette commented Jan 24, 2022

I confirm the csharp mono tests work with stock Ubuntu 20.04. Thanks for all the work on this!

Thanks

Just a note - I will be most out of contact and certainly not able to run builds from 16 Feb for two months - so I would like to get this to the point of being merged before that.

@szekerest
Copy link
Contributor

@rouault Looks like this addition is in a good shape to get it included, right?

@rouault rouault merged commit 6b98c8b into OSGeo:master Jan 25, 2022
@rouault
Copy link
Member

rouault commented Jan 25, 2022

Merged. Thanks a lot !

@runette runette deleted the csharp-fix branch January 25, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants