No subject
Tue Aug 6 13:31:21 EDT 2013
get_filename_component( BUILD_PRODUCT_ROOT ${CMAKE_SOURCE_DIR}/../.. ABSOLUTE )
set( CMAKE_MODULE_PATH
"${BUILD_PRODUCT_ROOT}/cmake"
"${BUILD_PRODUCT_ROOT}/cmake/find"
)
add_subdirectory( ${BUILD_PRODUCT_ROOT}/source source )
Note that the script "root/source/CMakeLists.txt" is where I begin
defining targets, and it never steps into "build" (to avoid infinite
recursion).
Later on (still in the root script) I do:
include( common )
This includes "root/cmake/common.cmake" as expected, but inside
common.cmake when I try to include a file (not a module) relative to
common.cmake, it says it can't find it. Example:
include( foo/bar/stuff.cmake )
The absolute path for this would be:
root/cmake/foo/bar/stuff.cmake
Naturally I assume that when including a FILE (not a module!) that it
is relative to the CMAKE_CURRENT_LIST_DIR, which in this case
correctly displays as "root/cmake".
Can anyone explain why I can't include files from common.cmake? Thanks
in advance.
More information about the CMake
mailing list