Timo Rumland wrote:
> Hello,
> 
> 
> 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".

What most of us usually do is setting the EXECUTABLE_OUTPUT_PATH
variable. SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin). In this
case, bin is a subdirectory in the build tree. If you want the bin
directory as a parent of the build tree (out of build tree) then you can
do something like this

GET_FILENAME_COMPONENT(EXECUTABLE_OUTPUT_PATH
                       ${CMAKE_BINARY_DIR}/../bin
                       ABSOLUTE
                       )
-- 
Filipe Sousa

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to