[Cmake] linux cmake 1.8 INCLUDE out-of-source problem

Zennard Sun zen at ll . mit . edu
Tue, 30 Dec 2003 11:36:09 -0500


Hi,
    I have tested the following with SunOS and Linux setups using CMake
versions 1.6 and 1.8.  I only have this problem with Linux CMake version
1.8 (with both 1.8.1 and 1.8.2 whereas Linux version 1.6.7 works).  I
have the following setup:

folder/src
(where the source files are as well as CMakeLists.txt)

folder/obj/linux
(the build directory where the out-of-source build goes)

folder/helper.txt
(a file I want to include into my CMakeLists.txt)

Inside folder/src/CMakeLists.txt I have the following two lines:

SET(file_path .. CACHE PATH "Offset to file location")
INCLUDE(${file_path}/helper.txt)

When I want to do an out of source build, I go to the folder/obj/linux
and type:

cmake ../../src -Dfile_path:string=../..

Since I am running an out-of-source build, I need to change the
file_path so it is correct from the build directory.  This used to work
with CMake version 1.6, however, now I get the following error:

INCLUDE Could not find include file: ../../helper.txt

This file does exist at the given location relative to the build
directory.  Any thoughts?

        Sincerely,
        Zennard Sun