[CMake] Find parent of ${PROJECT_SOURCE_DIR}

Ke Gao ke.gao.ut at gmail.com
Tue Aug 28 02:33:08 EDT 2018


Hi,

I tried different way of using GET_FILENAME_COMPONENT to find the parent
path of PROJECT_SOURCE_DIR, or another path relative to the parent of
PROJECT_SOURCE_DIR, never succeeded.

Can anybody help, thank you very much.

None of the following works. I'm using Cmake 2.8.12
GET_FILENAME_COMPONENT(SRC_DIR ${PROJECT_SOURCE_DIR}/../source/ PATH)
GET_FILENAME_COMPONENT(SRC_DIR ${PROJECT_SOURCE_DIR}/../source/ ABSOLUTE)
GET_FILENAME_COMPONENT(ANA_ROOT_DIR ${PROJECT_SOURCE_DIR} ABSOLUTE)
-- 
..............................................................................................................................................
Ke Gao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180828/e8d4c9ed/attachment.html>


More information about the CMake mailing list