changeset 199:9c85c3a34726

Cmake macro
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 19 Dec 2016 11:36:18 +0900
parents 4051c012dec3
children 207aff30ed34
files src/parallel_execution/CMakeLists.txt src/parallel_execution/generate_context.pl
diffstat 2 files changed, 7 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt	Sun Dec 18 21:48:40 2016 +0900
+++ b/src/parallel_execution/CMakeLists.txt	Mon Dec 19 11:36:18 2016 +0900
@@ -6,30 +6,22 @@
 
 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
  
-add_custom_command (
-      OUTPUT    c/enumCode.h
-      COMMAND  "perl" "generate_context.pl"
-)
-
 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} )
-
-    # message("target =  ${_Gears_TARGET}")
-    # message("sources =  ${_Gears_SOURCES}")
-
-    add_executable(${_Gears_TARGET} ${_Gears_SOURCES})
+    add_custom_command (
+          OUTPUT    c/enumCode.h
+          COMMAND  "perl" "generate_context.pl" ${_Gears_SOURCES}
+    )
+    add_executable(${_Gears_TARGET} ${_Gears_SOURCES} context.c c/enumCode.h )
 endmacro()
 
 GearsCommand(
   TARGET
       twice
   SOURCES 
-      main.c 
-      context.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c c/enumCode.h
+      main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c 
 )
 
--- a/src/parallel_execution/generate_context.pl	Sun Dec 18 21:48:40 2016 +0900
+++ b/src/parallel_execution/generate_context.pl	Mon Dec 19 11:36:18 2016 +0900
@@ -36,7 +36,7 @@
 system "rm -rf c";
 system "mkdir c";
 
-while (<*.c>) {
+while (<@ARGV>) {
     next if (/context.c/);
     &getStubInfo($_);
 }