Skip to content

Commit 7406caa

Browse files
authored
Add new option BUILD_FOR_DEBIAN_PACKAGE (#266)
* Refs #23644. Add new option BUILD_FOR_DEBIAN_PACKAGE Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #23644. Fix on windows Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> --------- Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent 6ee4ca5 commit 7406caa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fastdds_python/src/swig/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ target_link_libraries(${PROJECT_NAME}
7777
fastdds
7878
)
7979

80+
option(BUILD_FOR_DEBIAN_PACKAGE "Build for debian package" OFF)
81+
if (BUILD_FOR_DEBIAN_PACKAGE)
82+
set(GET_PATH_SCHEME "\'deb_system\',")
83+
endif()
84+
8085
# Find the installation path
81-
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )"
86+
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from sysconfig import get_path; print(get_path('purelib', ${GET_PATH_SCHEME} vars={'base': '${CMAKE_INSTALL_PREFIX}'}))"
8287
OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
8388
OUTPUT_STRIP_TRAILING_WHITESPACE
8489
)

0 commit comments

Comments
 (0)