-
Notifications
You must be signed in to change notification settings - Fork 280
Use cmake netCDF with target_* for many options #2847
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
Conversation
…or compile options
Kyle, could you begin making a checklist of conventions you are using to build cmake files. |
@DennisHeimbigner yes! I'll add it to #2845 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
90% of the issues are writing autotools in CMake, but they could be addressed later, just highlighted some as I read the PR. There are a few choices of public that should be discussed
liblib/CMakeLists.txt
Outdated
set_target_properties(netcdf PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR} | ||
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is, otherwise msvc will place the output in separate Debug or Release directories
Yes, I would say that's for another PR. I've made a note in #2845
@WardF this seems to be the biggest sticking point. Bumping to this version of cmake has a huge benefit in terms of simplifying finding and using HDF5, but does seem to drop support for older versions on windows. |
I'm seeing other issues, so far simply syntax related, on Windows. I'll make these changes and push them into the branch. |
…ts.txt. Correct the logic flow in libncxml/CMakeLists.txt to not try to include non-existant directory when libxml2 is not found.
…rl/curl.h using Visual Studio. There's another issue to correct, but this is getting us a lot closer.
…ng, setting compiler flags for VC, etc.
…haven't broken the Linux build
@DennisHeimbigner quick question, can you remind me why we explicitly disable filters/plugins in |
…es an unnecessary roadblock (at the moment). Re-formulated logic for determining what tests to run when. Need to figure out why plugins are turned off when MINGW is true, but that's a different issue. As of this push, all tests succeed on local windows system.
Update: shared build on Windows works, seeing failures with static build on Windows, will address that. |
…ing a static library. While it's reasonable to provide a mechanism to specify this, it is not necessarily true. We should also perhaps rename the NC_FIND_SHARED option, since LIBS implies it will look for static or shared libraries for all dependencies, but this logic only looks for HDF5. In any case, commenting this out for now until we can rework it.
Taking a last pass at this and seeing what the potential impact on other PR's from @ZedThree might be (amongst others); as it stands, this looks ok, despite the expected failure on appveyor. After merging this, I'll need to add the GitHub action-based tests for Windows+Visual Studio, but that will be a priority. We are focused on internship interviews tomorrow but I should be able to address the other tasks early next week. |
@WardF I know there's a PR moving the Windows CI to Github Actions, but might be worth just bumping the Appveyor image for this PR? modified appveyor.yml
@@ -1,4 +1,4 @@
-image: Visual Studio 2017
+image: Visual Studio 2019
environment:
matrix: |
That is easy enough to do, but my vague recollection was also there was a cmake version issue. But this will be a super easy change to make. And for what it's worth, the current failure in AppVeyor is not a roadblock to merging this, it's simply the next issue to deal with. And before I merge this PR, I want to get a better idea of the potential impact to the other PR's you've submitted; it will either go very smoothly, or be a bit of a mess; I just want to be prepared to address the latter immediately instead of getting bogged down :). Speaking of 'bogged down', the latter part of this week was a bit of an administrative time sink, but resolving this PR and the subsequent knock-on effects is top of the list for Monday. |
…to GitHub actions.
Yep, exactly, it's just the easiest way to bump the cmake version on Appveyor is to bump the base image version :) The remaining test failures look like the usual flaky server issues. |
Ignore the name of the branch
This branch
netcdf
target to the top level fileadd_compile_definitions
totarget_compile_definitions
on thenetcdf
cmake target. Some were not set on netCDFHAVE_CONFIG_H
used by the include files, libdap2, libap4, libdispatch, libncxml, libsrc, ncump, ncxarr, several pluginsDLL_NETCDF
, unclear on what the ramifications of setting this only on netcdf areDLL_EXPORT
, unclear on what the ramifications of setting this only on netcdf arenetCDF_LIB_CORENAME
from the top level cmake file; it wasn't used anywhereinclude_directories
, settarget_include_directories
withPRIVATE
scope since it seems unlikely more than the netcdf target would need theseThis partially addresses some stuff in #2845. In particular, setting the definitions on the netcdf target and not globally
@ZedThree @WardF @LecrisUT if