ssk
ssk

Reputation: 9265

rpath in LDFLAGS for CMAKE

I am currently porting my automake into CMAKE. I am trying to find what's equivalent of:

myprogram_LDFLAGS = \
   -lcurl \
   -ldl \
   -lresolv \
    -Wl,-rpath,'/approot/services/lib'

What is the corresponding command in cmake to set my rpath?

set(CMAKE_INSTALL_RPATH "/approot/services/lib")

The above command seems to be related to the install time. Whereas, LDFLAGS are linker related.

Upvotes: 2

Views: 977

Answers (1)

ssk
ssk

Reputation: 9265

This worked for me:

set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "-Wl,-rpath,'/approot/services/lib'")

Upvotes: 1

Related Questions