view src/parallel_execution/CMakeLists.txt @ 210:ba56dab79dc4

separate code init for each executable
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 27 Dec 2016 17:13:45 +0900
parents b6ffdd99e525
children 962fbfe777bb
line wrap: on
line source

cmake_minimum_required(VERSION 2.8)

# -DUSE_CUDA
#  add_definitions("-Wall -g -O")
add_definitions("-Wall -g")

set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
 
macro( GearsCommand )
    set( _OPTIONS_ARGS )
    set( _ONE_VALUE_ARGS TARGET )
    set( _MULTI_VALUE_ARGS SOURCES )
    cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
    add_custom_command (
          OUTPUT    c/${_Gears_TARGET}-context.c 
          COMMAND  "perl" "generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_SOURCES}
    )
    add_executable(${_Gears_TARGET} ${_Gears_SOURCES} c/${_Gears_TARGET}-context.c)
endmacro()


GearsCommand(
  TARGET
      twice
  SOURCES 
      main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c  stack.c  queue.c
)

GearsCommand(
  TARGET
      stack_test
  SOURCES 
      rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c test/stack_test.c stack.c  queue.c
)

GearsCommand(
  TARGET
      queue_test
  SOURCES 
      TaskManager.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c  stack.c test/queue_test.c queue.c
)