Victor Eijkhout
Victor Eijkhout

Reputation: 5794

How is the cmake install path constructed?

If I have a line install( TARGETS prog DESTINATION foo ) in my CMakeLists.txt, the target gets installed in CMAKE_INSTALL_PREFIX/foo/prog, so I figured having install( TARGETS prog ) would put it in CMAKE_INSTALL_PREFIX/prog. But no, it goes in CMAKE_INSTALL_PREFIX/bin/prog.

How can I install a target directly in the prefix location?

Upvotes: 0

Views: 396

Answers (1)

fabian
fabian

Reputation: 82461

You can use . as the destination:

install(TARGETS prog DESTINATION .)

If you don't specify the destination, the default path for executables is used, which is bin.

Upvotes: 1

Related Questions