Skip to content

Update cmake syntax #6

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

Merged
merged 2 commits into from
Jul 11, 2016
Merged

Conversation

hjmjohnson
Copy link
Contributor

All recent versions of cmake have migrated to preferring lowercase command directives and not replicating the conditionals in the "else" "end" parts of code blocks.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:
NOTE: MUST USE GNU compliant version of sed

cmake --help-command-list \
| grep -v "cmake version" \
| while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
  done >convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' \
   | xargs -0 gsed -i -f convert.sed \
&& rm convert.sed
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

NOTE: MUST USE GNU compliant version of sed
Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' \
   | xargs -0 gsed -i -f convert.sed \
&& rm convert.sed
@hjmjohnson
Copy link
Contributor Author

@julielangou FYI: All builds are passing.

@langou langou merged commit 5333ddd into Reference-LAPACK:master Jul 11, 2016
@langou
Copy link
Contributor

langou commented Jul 11, 2016

Thanks Hans, just reviewed the pull request, tested it and accepted it. Thanks a lot. Julien.

@hjmjohnson hjmjohnson deleted the UpdateCMakeSyntax branch July 28, 2016 17:25
langou pushed a commit that referenced this pull request Mar 8, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this pull request May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants