laza
laza

Reputation: 91

How to set Library directory for "Object" target

I would need to specify a library directory property for OBJECT target like this:

add_library( ObjTargetName OBJECT "main.cpp" )
set_target_properties( ObjTargetName PROPERTIES STATIC_LIBRARY_FLAGS "/DEF")

It is an OBJECT target, but there is /DEF flag. And because it is OBJECT target type and not SHARED so link_directories does not work for this case. Is there a way how to specify it? I am using cmake 3.13 and VC2017.
Thanks for any hint.

Upvotes: 0

Views: 323

Answers (1)

laza
laza

Reputation: 91

set_target_properties( ObjTargetName PROPERTIES STATIC_LIBRARY_OPTIONS "/DEF;/OUT:${IMPLIB_FILE_PATH}")

Upvotes: 1

Related Questions