> configure_file(src/config.h.in config.h)

In CMake, use of relative filenames is (mostly) discouraged. A robust
way to do this would be to write:

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in 
                ${CMAKE_CURRENT_BINARY_DIRECTORY}/include/config.h )

include_directories( ${CMAKE_CURRENT_BINARY_DIRECTORY}/include )

The "include_directories" tells cmake to add a 
"-I/path/to/tone12/build/include" directive,
so config.h can be found.

> 
> ~/tone12/src/CMakeLists.txt:
> add_executable(tone12 tone12.cpp midi.cpp midi.h riffwave.cpp riffwave.cpp 
> tonegen.cpp tonegen.h)
> configure_file(config.h.in config.h)

It's normally not a good idea to call configure_file twice. You have to decide
which of the two configure_file statements you really want (which fits your 
project style,
is more robust when changing directory names,...).

You have the same issue with relative paths here, as above. If you want to 
configure
your header here, you could write:

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 
                ${CMAKE_CURRENT_BINARY_DIRECTORY}/config.h )

include_directories( ${CMAKE_CURRENT_BINARY_DIRECTORY} )

(Current binary directory in this case evaluates to /path/to/tone12/build/src.)


HTH,
  Johannes


-- 
Johannes Zarl
Virtual Reality Services

Johannes Kepler University
Informationsmanagement

Altenbergerstrasze 69
4040 Linz, Austria
Phone: +43 732 2468-8321
johannes.z...@jku.at
http://vrc.zid.jku.at










_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to