Skip to content

Update cmake syntax - #6

Merged
langou merged 2 commits into
Reference-LAPACK:masterfrom
hjmjohnson:UpdateCMakeSyntax
Jul 11, 2016
Merged

langou merged 2 commits into
Reference-LAPACK:masterfrom
hjmjohnson:UpdateCMakeSyntax

Conversation

@hjmjohnson

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@julielangou FYI: All builds are passing.

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

langou commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

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