LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   CMake Question (https://www.linuxquestions.org/questions/programming-9/cmake-question-870715/)

MTK358 03-24-2011 08:50 AM

CMake Question
 
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}")


Reuti 03-25-2011 10:11 AM

Do you see any path setting for the libraries when executing:
Code:

$ ccmake .

MTK358 03-25-2011 12:51 PM

Quote:

Originally Posted by Reuti (Post 4303051)
Do you see any path setting for the libraries when executing:
Code:

$ ccmake .

I don't understand.

Reuti 03-25-2011 12:56 PM

ccmake (double c is not a typo) should open a configuration window, where you can setup some things like the final path of the build and so on. Maybe a path to a library is also provided there by the source in question.

knudfl 03-25-2011 01:22 PM

The manual : man ccmake


http://linux.die.net/man/1/ccmake


All times are GMT -5. The time now is 03:13 AM.