[CMake] Find parent of ${PROJECT_SOURCE_DIR}

Petr Kmoch petr.kmoch at gmail.com
Tue Aug 28 03:00:26 EDT 2018


Hi,

can you elaborate on how the commands you've shown "don't work?" What do
they do and how does it differ from what you need?

Petr

On Tue, 28 Aug 2018 at 08:33, Ke Gao <ke.gao.ut at gmail.com> wrote:

> 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
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180828/34cf6f8b/attachment.html>


More information about the CMake mailing list