CMakeLists.txt 520 Bytes
Newer Older
Ken Martin's avatar
Ken Martin committed
1
cmake_minimum_required (VERSION 2.6)
2
project(SubProject)
3 4 5 6 7 8 9 10
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/gen.cxx) # require generation
add_custom_command(
  OUTPUT gen.cxx
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in
  COMMAND ${CMAKE_COMMAND} -E copy
             ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in gen.cxx
  )
add_custom_target(gen DEPENDS gen.cxx)
11
add_library(bar bar.cxx)
12 13
target_include_directories(bar PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(bar gen)
14 15
add_executable(car car.cxx)
add_subdirectory(foo)