[CMake] CMAKE_CURRENT_LIST_DIR equivalent 2.8.2

David Cole dlrdave at aol.com
Fri Mar 14 11:30:27 EDT 2014


I do this to avoid using CMAKE_CURRENT_LIST_DIR in projects that must 
still work with older CMake versions:

  get_filename_component(_self_dir ${CMAKE_CURRENT_LIST_FILE} PATH)

After that call, the variable "_self_dir" has equivalent content to the 
present-day CMAKE_CURRENT_LIST_DIR.

CMAKE_CURRENT_LIST_FILE has been around for much longer.


HTH,
David C.



More information about the CMake mailing list