add_library(target1 funtion.c target1.c )
add_library(target2 funtion.c target2.c )
add_executable(main.out main.c)
target_link_libraries(main.out target1 target2 ${LDFLAGS})
Here is my CMakeLists.txt
above.
Both targets need to use the source file function.c
. It is able to run though. My concern is that maybe it is not a good behavior for writing CMakeList.txt
?