Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create alias for targets using CMake?

Suppose that I've got the following library:

add_library(myLib STATIC ${SRC_FILES})

In order to make this lib, I have to execute the following command:

make myLib

How can I create an alias for myLib, like lib, so that executing the following line makes the same target?

make lib
like image 534
B Faley Avatar asked Dec 12 '25 03:12

B Faley


1 Answers

add_library(foo foo.cpp )
add_custom_target(bar DEPENDS foo)
like image 146
steveire Avatar answered Dec 14 '25 09:12

steveire



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!