CMAKE_MINIMUM_REQUIRED(VERSION 2.8) ADD_CUSTOM_COMMAND(OUTPUT toto.h toto.c COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create_totoc_totoh.sh ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(titi toto.c) ADD_LIBRARY(tata tata.c)