Commit 42777830 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

python: use CMAKE_RUNTIME_OUTPUT_* properties instead of CMAKE_LIBRARY_OUTPUT_* for Windows

parent 7a8d3436
......@@ -31,7 +31,7 @@ target_link_libraries(dpsim_python dpsim ${PYTHON_LIBRARIES})
target_include_directories(dpsim_python PRIVATE ${PYTHON_INCLUDE_DIRS} ${INCLUDE_DIRS})
set_target_properties(dpsim_python
PROPERTIES
LIBRARY_OUTPUT_NAME "_dpsim"
OUTPUT_NAME "_dpsim"
SUFFIX ${PYTHON_EXT_SUFFIX}
PREFIX ""
INSTALL_RPATH ${INSTALL_RPATH}
......
......@@ -31,8 +31,7 @@ class CMakeBuild(build_ext):
def build_extension(self, ext):
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE',
cmake_args = ['-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE',
'-DPYTHON_EXECUTABLE=' + sys.executable,
'-DBUILD_EXAMPLES=OFF']
......@@ -40,12 +39,12 @@ class CMakeBuild(build_ext):
build_args = ['--config', cfg]
if platform.system() == "Windows":
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
cmake_args += ['-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + extdir]
if sys.maxsize > 2**32:
cmake_args += ['-A', 'x64']
build_args += ['--', '/m']
else:
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir]
build_args += ['--', '-j4']
env = os.environ.copy()
......
Supports Markdown
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