[CMake] Trying to find a directory

Timo Rumland cr at olympclan.de
Fri Nov 24 03:50:01 EST 2006


Hello,

> Not sure to understand your need
> but did you look at:
> 
> IF(EXISTS file-name)
> IF(EXISTS directory-name)
> or
> FILE(RELATIVE_PATH variable directory file)
> or
> GET_FILENAME_COMPONENT

yes I did. Perhaps I have not explained my problem properly.

My binary dir is "c:/project/test/buildfiles", the cmake variable ${PROJECT_BINARY_DIR} contains that automatically after I use the "PROJECT" command.

Now I want to set the path where to build the project binaries, in my case it is "c:/project/test/bin", BUT I never know the beginning of that path ("c:/project/test"), because I can't say where the user is on his system.

So I need to get the relative path "../bin" from "[whatever]/buildfiles" resulting in "[whatever]/bin".


More information about the CMake mailing list