cogged include/internal/bottles.hpp

This commit is contained in:
Nicholas O'Connor 2017-03-23 14:43:48 -07:00
parent d8760c321a
commit 6943ebfd87
3 changed files with 22 additions and 13 deletions

View File

@ -40,7 +40,7 @@ foreach(cogfile ${cogfiles})
string(REGEX REPLACE ".cog\$" "" outfile "${cogfile}")
set(thisfile "${CMAKE_CURRENT_SOURCE_DIR}/${outfile}")
add_custom_command(OUTPUT "${thisfile}"
add_custom_command(OUTPUT "${thisfile}" PRE_BUILD
COMMAND ${PYTHON_EXECUTABLE} -m cogapp -d -o "${outfile}" "${cogfile}"
DEPENDS ${cogfile}
COMMENT "Greasing the cog for ${thisfile}")
@ -50,6 +50,7 @@ endforeach(cogfile)
add_library(bottles SHARED ${src}/bottles/bottles.cpp
${src}/bottles/active.cpp ${src}/bottles/commands.cpp)
add_dependencies(bottles cog)
add_custom_target(cog ALL DEPENDS ${coggedfiles})

View File

@ -1,12 +0,0 @@
#ifndef __INTERNAL_BOTTLES_HPP
#define __INTERNAL_BOTTLES_HPP
#pragma once
namespace cellar {
namespace bottles {
extern void print_bottles(int,char**);
extern void print_active_bottle(int,char**);
}
}
#endif // __INTERNAL_BOTTLES_HPP

View File

@ -0,0 +1,20 @@
// vim: filetype=cpp :
#ifndef __INTERNAL_BOTTLES_HPP
#define __INTERNAL_BOTTLES_HPP
#pragma once
namespace cellar {
namespace bottles {
/*[[[cog
import cog
with open("src/bottles/commands.txt") as commandsfile:
for line in commandsfile:
item = line.split(" ")
cog.outl("extern void {0} (int, char**);".format(item[1]))
]]]*/
//[[[end]]]
}
}
#endif // __INTERNAL_BOTTLES_HPP