cmake_minimum_required(VERSION 3.16) project(Demo) add_library(hello hello.c hello-name.c) set_property(TARGET hello PROPERTY VERSION "1") install(TARGETS hello DESTINATION lib) # <-- lands in /lib/ install(FILES hello.h hello-name.h DESTINATION include) # <-- lands in /include/ add_executable(hello-first hello-first.c) target_link_libraries(hello-first hello) install(TARGETS hello-first DESTINATION bin) # <-- lands in /bin/ add_executable(hello-second hello-second.c) target_link_libraries(hello-second hello) install(TARGETS hello-second DESTINATION bin) # <-- lands in /bin/