I am trying to make a static library, for example my_lib.a
.
This library is depending from a gSoap code - file2.cpp.o
, which is generated because of this CMake instruction (and 2 custom commands):
add_library(${TARGET_NAME} ${SRC_FILES}
${GENERATED_SRC_FILES} ${GENERATED_H_FILES} ${GENERATED_RES_FILES})
file2.cpp
is present in GENERATED_SRC_FILES
. Everything runs fine until the moment of linking.
/usr/bin/ar cr ../lib/my_lib.a CMakeFiles/my_lib.dir/src/file1.cpp.o CMakeFiles/my_lib.dir/src/file2.cpp.o
If I let Make to use this command, the library my_lib.a
will contain
file1.cpp.o
and file2.cpp.o
. But in fact I do not need the file2.cpp.o
in my *.a library.
Does anyone know how I have to manage this case in a way to obtain a my_lib.a
which contains only the file1.cpp.o
?