[CMake] how to specify a different source directory

Dev Guy devguy.ca at gmail.com
Thu Feb 2 21:10:36 EST 2012


On Thu, Feb 2, 2012 at 7:46 PM, Dev Guy <devguy.ca at gmail.com> wrote:
> I have a project file and within it I have created a test folder and
> placed some testing code there. From my test CMakelist, I need to
> access a .cpp file from the parent folder but I am not sure how to do
> this?
>
> Thus the call to add_executable fails because it can't locate the source file.
>

OK I figured out when I pass in the source file to  add_executable, I
just need to prefix the source file with "../"

Is this the proper way to do it, or should I be using another cmake
command to declare a source folder?

Thanks,
Rajinder


More information about the CMake mailing list