FindSWIG: Use CMAKE_CURRENT_LIST_DIR instead of CMAKE_ROOT (#13771)

This is a simpler way to reference the location of UseSWIG.cmake.
This commit is contained in:
Julien Schueller 2013-11-21 14:50:21 +01:00 committed by Brad King
parent 75bfe4cbd0
commit 8c127c9e33
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ if(SWIG_EXECUTABLE)
set(SWIG_DIR SWIG_DIR-NOTFOUND) set(SWIG_DIR SWIG_DIR-NOTFOUND)
find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output}) find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
if(SWIG_DIR) if(SWIG_DIR)
set(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake) set(SWIG_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseSWIG.cmake)
execute_process(COMMAND ${SWIG_EXECUTABLE} -version execute_process(COMMAND ${SWIG_EXECUTABLE} -version
OUTPUT_VARIABLE SWIG_version_output OUTPUT_VARIABLE SWIG_version_output
ERROR_VARIABLE SWIG_version_output ERROR_VARIABLE SWIG_version_output