hello CMake community,

I am experimenting with external projects. I have some files in an external project which are generated in `${CMAKE_SOURCE_DIR}`.


When I add the external project, however, it is using `${CMAKE_SOURCE_DIR}` of the external project.


I need `${CMAKE_SOURCE_DIR}` to be relative to the "super build", instead of the external project path.


Example:

/message("${CMAKE_SOURCE_DIR} = /home/user/super")//
//
//ExternalProject_Add(ext1//
//    # directory options//
//    SOURCE_DIR      "${CMAKE_SOURCE_DIR}/ext1"//
//)/


${CMAKE_SOURCE_DIR}/ext1/CMakeLists.txt:


/message("${CMAKE_SOURCE_DIR} = /home/user/super/ext1")/


The desired outcome would be to have the path /home/user/super in both messages.
How can I do this?


thank you
-- 

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 via email to