PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 12, 2022

[FIXED] How to print messages after make done with cmake?

 July 12, 2022     build, cmake, makefile, message, post     No comments   

Issue

I'm trying to print messages after building process done using CMake.

I just want to inform the user after make command is done without any error.

How can I do it? I tried add_custom_target() but I cannot choose when to run.

Also, I tried add_custom_command(), again it doesn't give me the right result.

Any idea?

Thank you for your idea in advance.


Solution

You could, indeed, do the following:

add_custom_target( FinalMessage ALL
    ${CMAKE_COMMAND} -E cmake_echo_color --cyan "Compilation is over!"
    COMMENT "Final Message" )
add_dependencies( FinalMessage ${ALL_TARGETS} )

That custom target depending on the list of all the targets you previously defined, you make sure it will be run last.



Answered By - xStan
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing