[CMake] newbie q - where do I put what in which CMakeLists file? out of source build

Pierre Abbat phma at phma.optus.nu
Wed Mar 9 21:11:34 EST 2011


On Wednesday 09 March 2011 13:09:39 Michael Hertling wrote:
> Could you boil down your project to a minimal but complete example
> which demonstrates the issues with the header not being found and
> the files not being placed properly and post it here?

Here's an example of it compiling correctly, but making a package wrong: 
minimal.tar.gz .

-bash-4.1$ cd build
-bash-4.1$ cmake ../src
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
<snip>
-bash-4.1$ make
Scanning dependencies of target readmidi
[100%] Building CXX object CMakeFiles/readmidi.dir/midi.o
Linking CXX executable readmidi
[100%] Built target readmidi
-bash-4.1$ ./readmidi
Header, 6 bytes
Track, 19 bytes
Track, 655 bytes
Track, 675 bytes
Track, 1491 bytes
Track, 1334 bytes
-bash-4.1$ make package_source
<snip>
bash-4.1$ cd /tmp
-bash-4.1$ tar xvzf ~/minimal/build/minimal-0.1.1-Source.tar.gz
x minimal-0.1.1-Source/config.h.in
x minimal-0.1.1-Source/midi.h
x minimal-0.1.1-Source/CMakeLists.txt~
x minimal-0.1.1-Source/midi.cpp
x minimal-0.1.1-Source/CMakeLists.txt
x minimal-0.1.1-Source/midi.cpp~

For minimal2, follow the same steps except start with "cmake ..". The program 
doesn't compile; the package is rooted correctly, but contains contents of 
the build directory as well as the src directory.

Pierre
-- 
Jews use a lunisolar calendar; Muslims use a solely lunar calendar.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: minimal.tar.gz
Type: application/x-tgz
Size: 3255 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110309/e2072b67/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: minimal2.tar.gz
Type: application/x-tgz
Size: 3292 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110309/e2072b67/attachment-0001.bin>


More information about the CMake mailing list