SET(OBJS
${CMAKE_CURRENT_SOURCE_DIR}/libs/obj.o
)
ADD_EXECUTABLE(myProgram ${OBJS} <other-sources>)
SET_SOURCE_FILES_PROPERTIES(
${OBJS}
PROPERTIES
EXTERNAL_OBJECT true
GENERATED true
)
That worked for me. Apparently one must set these two properties, EXTERNAL_OBJECT and GENERATED.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…