From 6f97b67abda9553345b1948d63983e960f6df3ea Mon Sep 17 00:00:00 2001 From: quentin <quentin.leblanc@hesge.ch> Date: Wed, 12 Mar 2025 11:17:36 +0100 Subject: [PATCH] aded build of python package after compilation of wrapper so --- CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 535e6f2..0bf0419 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,17 +71,18 @@ target_compile_options(${LIBNAME} PRIVATE # Création des liens symboliques après la compilation add_custom_command(TARGET ${LIBNAME} POST_BUILD - COMMAND ln -sf ${LIBNAME}.so.${LIB_MAJOR_VERS} - COMMAND ln -sf ${LIBNAME}.so WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - COMMENT "Création des liens symboliques pour ${LIBNAME}" - COMMENT "Copie de libsandbox_wrapper.so.1.0.0 dans src/ar_sandbox/wrapper" - COMMAND cp libsandbox_wrapper.so.1.0.0 ../src/ar_sandbox/wrapper/"${LIBNAME}.so" + COMMENT "Copie de ${LIB_FULL_NAME} dans src/ar_sandbox/wrapper" + COMMAND ${CMAKE_COMMAND} + ARGS -E copy "lib${LIB_FULL_NAME}" ../src/ar_sandbox/wrapper/"${LIBNAME}.so" +) + +add_custom_command(TARGET ${LIBNAME} POST_BUILD + WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMENT "Création du module Python dans le répertoire dist/" + COMMAND python -m build .. # Création du module python en prenant en compte que cmake est exécuté dans un répertoir build situé à la racine du projet. ) # Installation de la bibliothèque et des fichiers d'en-tête install(TARGETS ${LIBNAME} DESTINATION lib) -install(DIRECTORY inc/ DESTINATION include) - -install(CODE "execute_process(COMMAND ln -sf ${LIB_FULL_NAME} ${CMAKE_INSTALL_PREFIX}/lib/${LIBNAME}.so.${LIB_MAJOR_VERS})") -install(CODE "execute_process(COMMAND ln -sf ${LIB_FULL_NAME} ${CMAKE_INSTALL_PREFIX}/lib/${LIBNAME}.so)") \ No newline at end of file +install(DIRECTORY inc/ DESTINATION include) \ No newline at end of file -- GitLab