From 0b9b57117f475bc649ce83cd5e842d828cc6e2fa Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Wed, 5 Jul 2017 13:24:28 -0700 Subject: [PATCH] no longer generating files into the source tree --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd03f0..7f54370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,11 +55,14 @@ file(GLOB_RECURSE cogfiles RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/*.cog") foreach(cogfile ${cogfiles}) + # thisfile = absolute path to output file + # outfile = relative path + # TODO: fix that string(REGEX REPLACE ".cog\$" "" outfile "${cogfile}") - set(thisfile "${CMAKE_SOURCE_DIR}/${outfile}") + set(thisfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") add_custom_command(OUTPUT "${thisfile}" PRE_BUILD - COMMAND ${PYTHON_EXECUTABLE} -m cogapp -d -o "${outfile}" "${cogfile}" + COMMAND ${PYTHON_EXECUTABLE} -m cogapp -d -o "${thisfile}" "${cogfile}" DEPENDS ${cogfile} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Greasing the cog for ${outfile}")