What does –target option mean in CMake?

If I have

add_executable(hello hello.cpp)

add_executable(goodbye goodbye.cpp)

then CMake creates ‘build targets’ for each executable. It also creates other build targets, such as the ‘all’ build target, which builds everything.

By default, if the target is not specified, the ‘all’ target is executed, meaning both hello and goodbye are built.

You can specify the target to build if you only want to build one of them.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)