Hi,

I've read the FAQ hopefully carefully. But I did run into a problem with a out-of-source-build:

---8<---
project(coolcoding)

# generate coolcoding's static lexer
set(COOLCODING_BAR_HPP ${PROJECT_BINARY_DIR}/include/foo/io/coolcoding/coolcoding_bar.hpp)

add_executable(generate_coolcoding_bar generate_coolcoding_bar.cpp)

add_custom_command(
   OUTPUT  ${COOLCODING_BAR_HPP}
   COMMAND generate_coolcoding_bar ${COOLCODING_BAR_HPP}
   )

add_custom_target(coolcoding_dfa DEPENDS ${COOLCODING_BAR_HPP})

set_source_files_properties(${COOLCODING_BAR_HPP} PROPERTIES GENERATED 1)
--->8---

The generation failed due to the fact, that I want to generate into ${PROJECT_BINARY_DIR}/include/foo/io/ the header.

The source file simply holds:

---8<---
int main(int argc, char* argv[])
{
    ...
    std::ofstream out(argc < 2 ? "coolcoding_bar.hpp" : argv[1]);
    ...
--->8---

What is the recommended way the generate header not in the source-build dir self (means where the generate_coolcoding_bar.cpp is placed)?

For the project self I have therefore to include $source/include and $build/include.

Thanks,
Olaf
--

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