CMakeDetermineCompilerId: Simplify src reference in IDE projects
When constructing the "id_src" value for substitution into VS or Xcode compiler id projects, the input "src" variable already contains the file name with no path so we do not need get_filename_component. We know this because CMAKE_DETERMINE_COMPILER_ID_WRITE already references "${src}" with this assumption.
This commit is contained in:
parent
2fd05f411b
commit
8306108fd6
|
@ -217,7 +217,7 @@ Id flags: ${testflags}
|
||||||
set(id_subsystem 1)
|
set(id_subsystem 1)
|
||||||
endif()
|
endif()
|
||||||
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
|
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
get_filename_component(id_src "${src}" NAME)
|
set(id_src "${src}")
|
||||||
configure_file(${CMAKE_ROOT}/Modules/CompilerId/VS-${v}.${ext}.in
|
configure_file(${CMAKE_ROOT}/Modules/CompilerId/VS-${v}.${ext}.in
|
||||||
${id_dir}/CompilerId${lang}.${ext} @ONLY)
|
${id_dir}/CompilerId${lang}.${ext} @ONLY)
|
||||||
if(CMAKE_VS_MSBUILD_COMMAND AND NOT lang STREQUAL "Fortran")
|
if(CMAKE_VS_MSBUILD_COMMAND AND NOT lang STREQUAL "Fortran")
|
||||||
|
@ -256,7 +256,7 @@ Id flags: ${testflags}
|
||||||
set(id_lang "${lang}")
|
set(id_lang "${lang}")
|
||||||
set(id_type ${CMAKE_${lang}_COMPILER_XCODE_TYPE})
|
set(id_type ${CMAKE_${lang}_COMPILER_XCODE_TYPE})
|
||||||
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
|
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
get_filename_component(id_src "${src}" NAME)
|
set(id_src "${src}")
|
||||||
if(CMAKE_XCODE_PLATFORM_TOOLSET)
|
if(CMAKE_XCODE_PLATFORM_TOOLSET)
|
||||||
set(id_toolset "GCC_VERSION = ${CMAKE_XCODE_PLATFORM_TOOLSET};")
|
set(id_toolset "GCC_VERSION = ${CMAKE_XCODE_PLATFORM_TOOLSET};")
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Reference in New Issue