Commit 3115593f authored by Craig Scott's avatar Craig Scott
Browse files

UseSWIG: Account for per-config subdir of multi-config generators

Fixes: #17875
parent aae2bcf8
Pipeline #97680 passed with stage
...@@ -278,7 +278,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) ...@@ -278,7 +278,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(CMAKE_SWIG_OUTDIR) if(CMAKE_SWIG_OUTDIR)
set(outdir ${CMAKE_SWIG_OUTDIR}) set(outdir ${CMAKE_SWIG_OUTDIR})
else() else()
set(outdir ${CMAKE_CURRENT_BINARY_DIR}) set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
endif() endif()
if(SWIG_OUTFILE_DIR) if(SWIG_OUTFILE_DIR)
...@@ -504,7 +504,7 @@ function(SWIG_ADD_LIBRARY name) ...@@ -504,7 +504,7 @@ function(SWIG_ADD_LIBRARY name)
if (UseSWIG_MODULE_VERSION VERSION_EQUAL 2) if (UseSWIG_MODULE_VERSION VERSION_EQUAL 2)
set (outputdir "${workingdir}/${_SAM_LANGUAGE}.files") set (outputdir "${workingdir}/${_SAM_LANGUAGE}.files")
else() else()
set (outputdir "${CMAKE_CURRENT_BINARY_DIR}") set (outputdir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
endif() endif()
endif() endif()
endif() endif()
......
...@@ -22,7 +22,7 @@ set_property(SOURCE "../example.i" ...@@ -22,7 +22,7 @@ set_property(SOURCE "../example.i"
swig_add_library(example1 swig_add_library(example1
LANGUAGE python LANGUAGE python
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python" OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python/${CMAKE_CFG_INTDIR}"
SOURCES ../example.i ../example.cxx) SOURCES ../example.i ../example.cxx)
set_target_properties (example1 PROPERTIES set_target_properties (example1 PROPERTIES
OUTPUT_NAME example OUTPUT_NAME example
...@@ -39,7 +39,7 @@ set_property(SOURCE "../example.i" PROPERTY GENERATED_COMPILE_OPTIONS ${c_flags} ...@@ -39,7 +39,7 @@ set_property(SOURCE "../example.i" PROPERTY GENERATED_COMPILE_OPTIONS ${c_flags}
swig_add_library(example2 swig_add_library(example2
LANGUAGE perl LANGUAGE perl
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Perl" OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Perl/${CMAKE_CFG_INTDIR}"
SOURCES ../example.i ../example.cxx) SOURCES ../example.i ../example.cxx)
set_target_properties (example2 PROPERTIES set_target_properties (example2 PROPERTIES
OUTPUT_NAME example OUTPUT_NAME example
......
...@@ -20,7 +20,7 @@ set_property(SOURCE "../example.i" ...@@ -20,7 +20,7 @@ set_property(SOURCE "../example.i"
swig_add_library(example1 swig_add_library(example1
LANGUAGE python LANGUAGE python
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python2" OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python2/${CMAKE_CFG_INTDIR}"
SOURCES ../example.i ../example.cxx) SOURCES ../example.i ../example.cxx)
set_target_properties (example1 PROPERTIES set_target_properties (example1 PROPERTIES
OUTPUT_NAME example OUTPUT_NAME example
...@@ -32,7 +32,7 @@ target_link_libraries(example1 PRIVATE Python2::Python) ...@@ -32,7 +32,7 @@ target_link_libraries(example1 PRIVATE Python2::Python)
# re-use sample interface file for another plugin # re-use sample interface file for another plugin
swig_add_library(example2 swig_add_library(example2
LANGUAGE python LANGUAGE python
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python3" OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python3/${CMAKE_CFG_INTDIR}"
SOURCES ../example.i ../example.cxx) SOURCES ../example.i ../example.cxx)
set_target_properties (example2 PROPERTIES set_target_properties (example2 PROPERTIES
OUTPUT_NAME example OUTPUT_NAME example
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment