I have a CMake project with two subdirectories: one with the sources for a shared lib and the other with sources for an executable (which depends on the shared lib).
The problem is that the shared lib has a file called "common.h.in", which is converted to "common.h" in the build directory by CMake. This is fine, but when the executable includes a header file from the shared lib that includes common.h, it fails to compile because common.h isn't there.
What should I do?
Form the shared lib's CMakeLists.txt:
Code:
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/common.h.in
${CMAKE_CURRENT_BINARY_DIR}/common.h)
include_directories ("${CMAKE_CURRENT_BINARY_DIR}")