PDA

View Full Version : CMake and subdirectories



elcuco
23rd May 2012, 19:52
I have this project which compiles using cmake, it compiles and works perfectly.

Now, I want to embed this project as a subdir of another project using cmake the add_subdirectory() function.

The problem I face is that the nested project uses:



INCLUDE_DIRECTORIES( ../ . ${CMAKE_BINARY_DIR} )


However the problem is that the ${CMAKE_BINARY_DIR} is set to the top level directory, and when generating UI files the files are generated on the nested binary dir. Apparently I am doing something wrong, can anyone guide me?

elcuco
24th May 2012, 21:05
Solution: use this variable instead


CMAKE_CURRENT_BINARY_DIR