<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mehdi Rabah wrote:
<blockquote
 cite="midbb663b520612150526p4823c4ccj366da1e8e17ef8e9@mail.gmail.com"
 type="cite">
  <meta http-equiv="Context-Type"
 content="text/html; charset=ISO-8859-1">
Hi everyone,<br>
  <br>
I'm new to cmake, and there's something simple I don't know how to do.<br>
Here what I wrote in CMakeLists.txt so far:<br>
  <br>
project(test)<br>
subdirs(src)<br>
  <br>
and in src directory I have another CMakeLists.txt
:<br>
  <br>
add_executable(testApp Applications/testApp.cpp) <br>
  <br>
and what I want is that the compilation result of testApp.cpp goes into
the ./bin directory, but by default it goes into ./src<br>
</blockquote>
<br>
from the 2.4.5 docs:<br>
ADD_SUBDIRECTORY(source_dir [binary_dir] [EXCLUDE_FROM_ALL])<br>
<br>
You want:<br>
<br>
PROJECT(test)<br>
ADD_SUBDIRECTORY(src bin)<br>
<br>
<br>
<blockquote
 cite="midbb663b520612150526p4823c4ccj366da1e8e17ef8e9@mail.gmail.com"
 type="cite"><br>
Also, in src I have a lot of temporary files (cmake_install.cmake,
CMakeFiles, ...), how can I avoid having this in my subdirectories ? </blockquote>
<br>
Do an out-of-directory build.&nbsp; Then your src tree is never polluted by
anything.<br>
<br>
<br>
<blockquote
 cite="midbb663b520612150526p4823c4ccj366da1e8e17ef8e9@mail.gmail.com"
 type="cite">Should I write one only CMakeLists.txt in the root
directory ?<br>
</blockquote>
<br>
If your project is very simple, yes.<br>
<br>
<br>
<br>
Cheers,<br>
Brandon Van Every<br>
<br>
</body>
</html>