Find parent of ${PROJECT_SOURCE_DIR}

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Find parent of ${PROJECT_SOURCE_DIR}

Ke Gao
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
Reply | Threaded
Open this post in threaded view
|

Re: Find parent of ${PROJECT_SOURCE_DIR}

Petr Kmoch
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 <[hidden email]> 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

--

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