cmake_minimum_required (VERSION 2.6) project (HelloWorld C) set(CMAKE_C_FLAGS "-std=c99 -g -Wall") set(CMAKE_INSTALL_PREFIX "install") include_directories(mylib) # link_directories(mylib) add_executable(hello hello.c pouet.c) target_link_libraries(hello m mylib) install(TARGETS hello RUNTIME DESTINATION bin) add_subdirectory(mylib)