I have a situation where I want my CMakeLists.txt in a different place than my 
source.

e.g.:

/some/path/project/CMakeLists.txt
/other/path/source/src/a.c
/other/path/source/include/a.h

Is there an easy way to say "process this CMakeLists.txt as if it were in 
/other/path/source" (at least as far as file paths are concerned)?

e.g.:

add_library(my_lib
        src/a.c
        include/a.h
)

target_include_directories(my_lib PUBLIC include)

I know I can add a full path prefix to every file, but there are a lot of them. 
 I'm hoping for a shortcut.

--
Andrew


-- 

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