Skip to content

Update the FindCasacore script to include version info#291

Merged
aroffringa merged 6 commits intomasterfrom
update-find-casacore-script
Apr 13, 2026
Merged

Update the FindCasacore script to include version info#291
aroffringa merged 6 commits intomasterfrom
update-find-casacore-script

Conversation

@aroffringa
Copy link
Copy Markdown
Contributor

No description provided.

@aroffringa aroffringa requested a review from gmloose April 10, 2026 19:22
@aroffringa aroffringa force-pushed the update-find-casacore-script branch from c33f2d3 to aea8296 Compare April 10, 2026 22:27
Copy link
Copy Markdown
Collaborator

@gmloose gmloose left a comment

Choose a reason for hiding this comment

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

LGTM, but see my comment.

Comment thread cmake/FindCasacore.cmake Outdated
Comment on lines +214 to +220
# Use 'find_package' directly for HDF5, since 'casacore_find_package'
# does not support the extra 'COMPONENTS CXX' arguments.
find_package(HDF5 COMPONENTS CXX)
if (HDF5_FOUND)
list(APPEND CASACORE_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
list(APPEND CASACORE_LIBRARIES ${HDF5_LIBRARIES})
endif(HDF5_FOUND)
Copy link
Copy Markdown
Collaborator

@gmloose gmloose Apr 10, 2026

Choose a reason for hiding this comment

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

I propose to fix the macro casacore_find_package instead as follows:

macro(casacore_find_package _name)
  set(_arg_list ${ARGN})
  if(NOT Casacore_FIND_REQUIRED OR CASACORE_MAKE_REQUIRED_EXTERNALS_OPTIONAL)
    list(REMOVE_ITEM _arg_list "REQUIRED")
  endif()
  find_package(${_name} ${_arg_list})
  if(${_name}_FOUND)
    list(APPEND CASACORE_INCLUDE_DIRS ${${_name}_INCLUDE_DIRS})
    list(APPEND CASACORE_LIBRARIES ${${_name}_LIBRARIES})
  endif(${_name}_FOUND)
endmacro(casacore_find_package _name)

Then here, we have just a one-liner change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I've applied it. This FindCasacore script comes from DP3 by the way, so we might update that one as well :) (as well as WSClean).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(could you check if the call to the macro and code around is correct? I.e. the one here https://github.com/casacore/python-casacore/pull/291/changes#diff-dca8aead57c8ac2a5091ef3f09fc6ca2d75730189ad38cf6ff82dbaa74e82904R212 ).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, that should be good.

Copy link
Copy Markdown
Collaborator

@gmloose gmloose left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@aroffringa aroffringa merged commit 6bb837f into master Apr 13, 2026
5 of 6 checks passed
@aroffringa aroffringa deleted the update-find-casacore-script branch April 13, 2026 07:54
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.

2 participants