 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CMake &#8211; Automatically regenerate a file using an external tool and custom target upon &#8220;make&#8221;</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/cmake-automatically-regenerate-a-file-using-an-external-tool-and-custom-target-upon-make/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/cmake-automatically-regenerate-a-file-using-an-external-tool-and-custom-target-upon-make/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 12:14:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: originalcopy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cmake-automatically-regenerate-a-file-using-an-external-tool-and-custom-target-upon-make/#comment-58354</link>
		<dc:creator>originalcopy</dc:creator>
		<pubDate>Fri, 05 Dec 2008 11:03:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-58354</guid>
		<description><![CDATA[OOps, I&#039;ve forgot to paste the parser/CMakeLists.txt:

&lt;pre&gt;     1	set(parser_odir &quot;${CMAKE_CURRENT_BINARY_DIR}/&quot;)
     2	include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${parser_odir})
     3	
     4	add_custom_command(
     5			OUTPUT &quot;${parser_odir}lemon_parser.c&quot; &quot;${parser_odir}lemon_parser.h&quot; &quot;${parser_odir}lemon_parser.out&quot;
     6			#COMMAND ${PROJECT_BINARY_DIR}/lemon/lemon d=&quot;${CMAKE_CURRENT_SOURCE_DIR}/lempar.c&quot; &quot;${CMAKE_CURRENT_BINARY_DIR}/lemon_parser.y&quot;
     7			COMMAND ${PROJECT_BINARY_DIR}/lemon/lemon d=&quot;${CMAKE_CURRENT_SOURCE_DIR}/lempar.c&quot; &quot;${parser_odir}lemon_parser.y&quot;
     8			DEPENDS lemon &quot;${CMAKE_CURRENT_SOURCE_DIR}/lemon_parser.y&quot;
     9		)
    10	#add_custom_target(lemon_parser)
    11	file(READ lemon_parser.y parser_content)
    12	file(WRITE &quot;${parser_odir}lemon_parser.y&quot; &quot;${parser_content}&quot;)
    13	
    14	add_custom_command(
    15			OUTPUT &quot;${parser_odir}scanner.c&quot; 
    16			COMMAND re2c -i &quot;${CMAKE_CURRENT_SOURCE_DIR}/scanner.re&quot; &gt; &quot;${parser_odir}scanner.c&quot;
    17			DEPENDS &quot;${parser_odir}lemon_parser.h&quot; &quot;${CMAKE_CURRENT_SOURCE_DIR}/scanner.re&quot;
    18		)
    19	#add_custom_target(re2c_scanner)
    20	
    21	#add_custom_target(lemon_parser ALL DEPENDS &quot;${parser_odir}lemon_parser.c&quot; &quot;${parser_odir}lemon_parser.h&quot;)
    22	add_library(parser STATIC &quot;${parser_odir}lemon_parser.c&quot; &quot;${parser_odir}scanner.c&quot; parser.c ast.c)&lt;/pre&gt;


Is there any feedback area? The small &quot;ask a question&quot; textarea on the right is hard to use.]]></description>
		<content:encoded><![CDATA[<p>OOps, I&#8217;ve forgot to paste the parser/CMakeLists.txt:</p>
<pre>     1	set(parser_odir "${CMAKE_CURRENT_BINARY_DIR}/")
     2	include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${parser_odir})
     3	
     4	add_custom_command(
     5			OUTPUT "${parser_odir}lemon_parser.c" "${parser_odir}lemon_parser.h" "${parser_odir}lemon_parser.out"
     6			#COMMAND ${PROJECT_BINARY_DIR}/lemon/lemon d="${CMAKE_CURRENT_SOURCE_DIR}/lempar.c" "${CMAKE_CURRENT_BINARY_DIR}/lemon_parser.y"
     7			COMMAND ${PROJECT_BINARY_DIR}/lemon/lemon d="${CMAKE_CURRENT_SOURCE_DIR}/lempar.c" "${parser_odir}lemon_parser.y"
     8			DEPENDS lemon "${CMAKE_CURRENT_SOURCE_DIR}/lemon_parser.y"
     9		)
    10	#add_custom_target(lemon_parser)
    11	file(READ lemon_parser.y parser_content)
    12	file(WRITE "${parser_odir}lemon_parser.y" "${parser_content}")
    13	
    14	add_custom_command(
    15			OUTPUT "${parser_odir}scanner.c" 
    16			COMMAND re2c -i "${CMAKE_CURRENT_SOURCE_DIR}/scanner.re" &gt; "${parser_odir}scanner.c"
    17			DEPENDS "${parser_odir}lemon_parser.h" "${CMAKE_CURRENT_SOURCE_DIR}/scanner.re"
    18		)
    19	#add_custom_target(re2c_scanner)
    20	
    21	#add_custom_target(lemon_parser ALL DEPENDS "${parser_odir}lemon_parser.c" "${parser_odir}lemon_parser.h")
    22	add_library(parser STATIC "${parser_odir}lemon_parser.c" "${parser_odir}scanner.c" parser.c ast.c)</pre>
<p>Is there any feedback area? The small &#8220;ask a question&#8221; textarea on the right is hard to use.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.016 seconds using memcached
Object Caching 268/271 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 12:14:57 -->