Skip to content

modules: Fix test command when library output path is set - #77

Closed
Squareys wants to merge 1 commit into
mosra:masterfrom
Squareys:use-corrade-with-library-path
Closed

Squareys wants to merge 1 commit into
mosra:masterfrom
Squareys:use-corrade-with-library-path

Conversation

@Squareys

@Squareys Squareys commented Sep 15, 2019 •

Copy link
Copy Markdown
Contributor

Hi @mosra !

This is a tiny one, but would help me with maintenance a bit if it were to be upstreamed :)

Best,
Jonathan

From the commit message:

E.g. when `LIBRARY_OUTPUT_PATH` is set globally or the target property
`LIBRARY_OUTPUT_DIRECTORY` is set.

add_test(<name> <command> <args>) does not resolve the target file, but
rather just runs the command, which works as long as it is where cmake
puts in by default, but not if the library output dir is modified.

add_test(NAME <name> COMMAND <command> <args>) on the other hand resolves
generator expressions and <command>, if an executable target, will
"automatically be replaced by the location of the executable created at
build time." (from the cmake docs.)

@Squareys
Squareys force-pushed the use-corrade-with-library-path branch from 77102ed to 8cc50fe Compare September 15, 2019 22:13
@mosra

mosra commented Sep 15, 2019

Copy link
Copy Markdown
Owner

Unlike the above NAME signature no transformation is performed on the command-line to support target names or generator expressions.

cmake what the hell.

Can you add a changelog entry as well so I don't have to? :)

@mosra mosra added this to the 2019.0b milestone Sep 15, 2019
@Squareys

Copy link
Copy Markdown
Contributor Author

Sure!

cmake what the hell.

That's documented, though :D

@mosra

mosra commented Sep 16, 2019

Copy link
Copy Markdown
Owner

I mean, I see no reason at all why the shorthand version would need to behave so differently.

E.g. when `LIBRARY_OUTPUT_PATH` is set globally or the target property
`LIBRARY_OUTPUT_DIRECTORY` is set.

add_test(<name> <command> <args>) does not resolve the target file, but
rather just runs the command, which works as long as it is where cmake
puts in by default, but not if the library output dir is modified.

add_test(NAME <name> COMMAND <command> <args>) on the other hand resolves
generator expressions and <command>, if an executable target, will
"automatically be replaced by the location of the executable created at
build time." (from the cmake docs.)

Signed-off-by: Squareys <squareys@googlemail.com>
@Squareys
Squareys force-pushed the use-corrade-with-library-path branch from 8cc50fe to 114e58d Compare September 16, 2019 14:21
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #77 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #77   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files          86       86           
  Lines        5732     5732           
=======================================
  Hits         5604     5604           
  Misses        128      128

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c577cd...114e58d. Read the comment docs.

@Squareys

Copy link
Copy Markdown
Contributor Author

Done ✔️

@mosra

mosra commented Sep 20, 2019

Copy link
Copy Markdown
Owner

Merged as 9298434, thanks!

@mosra mosra closed this Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants