~townsend/ubuntu-app-launch/remove-xmir-helpers

« back to all changes in this revision

Viewing changes to cmake/UseConstantBuilder.cmake

  • Committer: Ted Gould
  • Date: 2013-07-24 21:13:19 UTC
  • mto: (33.6.1 libupstart-flesh)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: ted@gould.cx-20130724211319-jfznxhm4h7s0nuk2
Base CMake stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
cmake_minimum_required(VERSION 2.6)
 
2
if(POLICY CMP0011)
 
3
  cmake_policy(SET CMP0011 NEW)
 
4
endif(POLICY CMP0011)
 
5
 
 
6
macro(add_constant_template outfiles name const_name input)
 
7
  set(file_target "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
 
8
  add_custom_command(
 
9
    OUTPUT ${file_target}
 
10
    COMMAND ${CMAKE_COMMAND}
 
11
        "-Dname=${name}"
 
12
        "-Dfile_target=${file_target}"
 
13
        "-Dconst_name=${const_name}"
 
14
        "-Dinput=${input}"
 
15
        -P "${CMAKE_SOURCE_DIR}/cmake/ConstantBuilderTemplates.cmake"
 
16
    DEPENDS "${CMAKE_SOURCE_DIR}/cmake/ConstantBuilderTemplates.cmake" "${input}"
 
17
  )
 
18
  list(APPEND ${outfiles} "${file_target}")
 
19
endmacro(add_constant_template)