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

[WIP] CMake build with Visual Studio support #289

Closed
wants to merge 265 commits into from

Conversation

rkanavath
Copy link

@rkanavath rkanavath commented Jan 20, 2020

Hello all,

This is a very BIG pr! that adds cmake support for GRASS GIS!.

I have been working on and off mostly for fun!. Initial work started on grass-ci fork and then I recently rebased changes against proper upstream.

This new CMake support comes with Visual Studio support (adding a bunch of ifdef, declspec etc..). This PR allows windows users to use native C compiler and not MINGW. PR itself does not add anything to break MINGW support.

  • Autoconf build still works as normal.
  • On Windows, /gisbase is portable. So you can build grass, zip, and distribute..
    There are still some missing bits required in cmake build such as man pages, locale, make install target.

Current code can build all grass that can be run from build directory. I had tagged with "WIP".

Reviews and feedback are welcome,

neteler added a commit that referenced this pull request Feb 17, 2020
neteler added a commit that referenced this pull request Feb 17, 2020
trivial changes (comment style) applied
@rkanavath
Copy link
Author

I recommend to hold on review (unless checking cmake) on this PR. I will make seperate PR each with its own issues later.

rkanavath added a commit to rkanavath/grass that referenced this pull request Feb 17, 2020
This is not a search and replace of __MING32__ with _WIN32.
There are places where __MINGW32__ is still used and all changes are
tested with MSVC 2019 compiler. Although, this commit alone will not work
on MSVC because there are plenty of other things to be done which are
seperated into multiple PR. PR OSGeo#289 is the one that "works" on MSVC and
unix as well. But that contains too many changes which shouldn't in a single
PR. Even though this PR alone won't compile GRASS GIS on MSVC, it sure will
not break existing compilers which I think is very important.

Complete support for MSVC will be ready after 2/3 PRs

OSGeo#289
rkanavath added a commit to rkanavath/grass that referenced this pull request Feb 17, 2020
This is not a search and replace of __MING32__ with _WIN32.
There are places where __MINGW32__ is still used and all changes are
tested with MSVC 2019 compiler. Although, this commit alone will not work
on MSVC because there are plenty of other things to be done which are
seperated into multiple PR. PR OSGeo#289 is the one that "works" on MSVC and
unix as well. But that contains too many changes which shouldn't in a single
PR. Even though this PR alone won't compile GRASS GIS on MSVC, it sure will
not break existing compilers which I think is very important.

Complete support for MSVC will be ready after 2/3 PRs

OSGeo#289
@rkanavath rkanavath mentioned this pull request Feb 17, 2020
rkanavath added a commit to rkanavath/grass that referenced this pull request Feb 17, 2020
This is not a search and replace of __MING32__ with _WIN32.
There are places where __MINGW32__ is still used and all changes are
tested with MSVC 2019 compiler. Although, this commit alone will not work
on MSVC because there are plenty of other things to be done which are
seperated into multiple PR. PR OSGeo#289 is the one that "works" on MSVC and
unix as well. But that contains too many changes which shouldn't in a single
PR. Even though this PR alone won't compile GRASS GIS on MSVC, it sure will
not break existing compilers which I think is very important.

Complete support for MSVC will be ready after 2/3 PRs

OSGeo#289
@ninsbl ninsbl mentioned this pull request Oct 10, 2021
@neteler neteler added the enhancement New feature or request label Dec 9, 2021
@neteler neteler added this to the 8.2.0 milestone Dec 9, 2021
@wenzeslaus wenzeslaus modified the milestones: 8.2.0, 8.4.0 Feb 27, 2022
@neteler
Copy link
Member

neteler commented Dec 3, 2022

FYI: I have locally rebased this PR and will first separate out the INFINITY/NAN changes into a new PR, then update this PR.

neteler added a commit to neteler/grass that referenced this pull request Dec 3, 2022
- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289
@neteler
Copy link
Member

neteler commented Dec 3, 2022

will first separate out the INFINITY/NAN changes into a new PR, then update this PR.

See #2681

@petrasovaa
Copy link
Contributor

FYI: I have locally rebased this PR and will first separate out the INFINITY/NAN changes into a new PR, then update this PR.

Note that latest work on CMake is in #348.

@neteler
Copy link
Member

neteler commented Dec 4, 2022

Yes, I'm aware of it. I rebased this PR locally to extract the C related changes into a new PR.
For the cmake changes I'll probably switch to the other PR and rebase that, dropping this PR.

@neteler
Copy link
Member

neteler commented Dec 5, 2022

I have rebased this PR to main in #2684, closing here to avoid confusion.
Thanks for your hard work, @rkanavath!

@neteler neteler closed this Dec 5, 2022
@neteler neteler removed this from the 8.3.0 milestone Dec 5, 2022
neteler added a commit to neteler/grass that referenced this pull request Jan 11, 2023
- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
neteler added a commit that referenced this pull request Jan 16, 2023
* cmake support preparation: use of INFINITY and NAN

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR #289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
* cmake support preparation: use of INFINITY and NAN

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
neteler added a commit to nilason/grass that referenced this pull request Nov 7, 2023
* cmake support preparation: use of INFINITY and NAN

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants