<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20856">
<style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, 
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, 
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;"><div>You’re doing it all wrong. You do not name source files as make targets, but the target name (or project name, I have no idea, because it rarely makes sense to name them differently). Try simply “foo” or “custom-command-target”. You would never say “make foo.cpp”, not even in an ordinary GNU Make script.<br></div><div data-signatureblock="true"><br></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;'><b>Feladó:</b> <a href="mailto:Dave@Yost.com" target="_parent">Dave Yost</a><br><b>Elküldve:</b> ‎péntek‎, ‎2015‎. ‎június‎ ‎12‎. ‎2‎:‎00<br><b>Címzett:</b> <a href="mailto:cmake@cmake.org" target="_parent">cmake@cmake.org</a></font></div></div><div><br></div><div dir=""><div>In this example, how do I get</div><div>   make <a href="http://foo.cc" target="_parent">foo.cc</a></div><div>to work?</div><div><br></div><div><div style="margin: 0px; color: rgb(255, 207, 130); font-family: Menlo; font-size: 9px; background-color: rgb(5, 13, 17);"><div style="margin: 0px;">0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target</div><div style="margin: 0px; color: rgb(255, 255, 255);"><span style="color: rgb(255, 207, 130);">369 Z% </span>bundle CMakeLists.txt genFoo</div><div style="margin: 0px; color: rgb(255, 255, 255);">#!/usr/bin/env unbundle</div><div style="margin: 0px; color: rgb(255, 255, 255);"># See <a href="http://yost.com/computers/bundle/" target="_parent">http://yost.com/computers/bundle/</a></div><div style="margin: 0px; color: rgb(255, 255, 255);">======== CMakeLists.txt</div><div style="margin: 0px; color: rgb(255, 255, 255);">cmake_minimum_required(VERSION 3.3.0)</div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255);">project(custom-command-target)</div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255);">add_custom_command (</div><div style="margin: 0px; color: rgb(255, 255, 255);">  OUTPUT  <a href="http://foo.cc" target="_parent">foo.cc</a></div><div style="margin: 0px; color: rgb(255, 255, 255);">  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo > <a href="http://foo.cc" target="_parent">foo.cc</a></div><div style="margin: 0px; color: rgb(255, 255, 255);">  )</div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255);">add_executable (foo <a href="http://foo.cc" target="_parent">foo.cc</a>)</div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255);">======== genFoo</div><div style="margin: 0px; color: rgb(255, 255, 255);">#!/bin/bash</div><div style="margin: 0px; color: rgb(255, 255, 255); min-height: 10px;"><br></div><div style="margin: 0px; color: rgb(255, 255, 255);">echo "</div><div style="margin: 0px; color: rgb(255, 255, 255);">int main() {</div><div style="margin: 0px; color: rgb(255, 255, 255);">  return 0;</div><div style="margin: 0px; color: rgb(255, 255, 255);">}"</div><div style="margin: 0px; color: rgb(255, 255, 255);">========</div><div style="margin: 0px;">0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target</div><div style="margin: 0px; color: rgb(255, 255, 255);"><span style="color: rgb(255, 207, 130);">370 Z% </span>cd build                                                </div><div style="margin: 0px;">0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build</div><div style="margin: 0px; color: rgb(255, 255, 255);"><span style="color: rgb(255, 207, 130);">371 Z% </span>cmake ..                                                </div><div style="margin: 0px; color: rgb(255, 255, 255);">-- Configuring done</div><div style="margin: 0px; color: rgb(255, 255, 255);">-- Generating done</div><div style="margin: 0px; color: rgb(255, 255, 255);">-- Build files have been written to: /Users/yost/p/c++/cmake/custom-command-target/build</div><div style="margin: 0px;">0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build</div><div style="margin: 0px; color: rgb(255, 255, 255);"><span style="color: rgb(255, 207, 130);">372 Z% </span>make clean                                              </div><div style="margin: 0px;">0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build</div><div style="margin: 0px; color: rgb(255, 255, 255);"><span style="color: rgb(255, 207, 130);">373 Z% </span>make <a href="http://foo.cc" target="_parent">foo.cc</a>                                             </div><div style="margin: 0px; color: rgb(255, 255, 255);">make: *** No rule to make target '<a href="http://foo.cc" target="_parent">foo.cc</a>'.  Stop.</div><div style="margin: 0px;">2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build</div><div style="margin: 0px;">374 Z% </div><div><br></div></div></div><div><br></div></div></div>
</body>
</html>