Skip to content
Snippets Groups Projects
Commit e28df655 authored by Alexandre Eberhardt's avatar Alexandre Eberhardt
Browse files

build: improve CMakeLists.txt for several plugins

Clean CMakelists by using SDK path and requiring python3

Change-Id: Ie500e1ddf5d5f87fcf2a98b825d2ca55ee934eaa
parent a5fecc57
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,8 @@ set(plugin_HDR ...@@ -63,6 +63,8 @@ set(plugin_HDR
# Create shared library # Create shared library
add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR}) add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR})
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
target_include_directories(${ProjectName} PUBLIC target_include_directories(${ProjectName} PUBLIC
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}
...@@ -102,7 +104,7 @@ else() ...@@ -102,7 +104,7 @@ else()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
endif() endif()
...@@ -110,7 +112,7 @@ endif() ...@@ -110,7 +112,7 @@ endif()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
--arch=${ARCH} --distribution=${DISTRIBUTION} --arch=${ARCH} --distribution=${DISTRIBUTION}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
...@@ -126,6 +128,6 @@ add_custom_command( ...@@ -126,6 +128,6 @@ add_custom_command(
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
POST_BUILD POST_BUILD
COMMAND python3 ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName}
COMMENT "Generating JPL archive" COMMENT "Generating JPL archive"
) )
...@@ -48,12 +48,6 @@ set (JPL_FILE_NAME ${ProjectName}.jpl) ...@@ -48,12 +48,6 @@ set (JPL_FILE_NAME ${ProjectName}.jpl)
set (SDK_PATH ${JAMI_PLUGINS_PATH}/SDK) set (SDK_PATH ${JAMI_PLUGINS_PATH}/SDK)
set (PLUGIN_OUTPUT_DIR ${JPL_DIRECTORY}/lib/${DISTRIBUTION}) set (PLUGIN_OUTPUT_DIR ${JPL_DIRECTORY}/lib/${DISTRIBUTION})
option(VIDEO_FFMPEG "If you'd like to listen to Jami's video stream or modify it, set to ON." OFF) # {FILL}
option(AUDIO_FFMPEG "If you'd like to listen to Jami's audio stream or modify it, set to ON." OFF) # {FILL}
option(ARCHIVE_JPL "If you'd like to end the build process before the generation of a JPL archive, set to OFF." ON) # {FILL}
option(NVIDIA "To disable hardware acceleration and use the graphics card for ONNX computation (useful for AI plugins), set to ON." OFF) # {FILL}
option(CERTIFICATION "If you'd like to certify the JPL archive created by ARCHIVE_JPL, set to ON. Requires ARCHIVE_JPL to be ON." ON) # {FILL}
message(Distribution:\ ${DISTRIBUTION}) message(Distribution:\ ${DISTRIBUTION})
message(Building:\ ${ProjectName} ${Version}) message(Building:\ ${ProjectName} ${Version})
message(Build\ path:\ ${PROJECT_BINARY_DIR}) message(Build\ path:\ ${PROJECT_BINARY_DIR})
...@@ -86,6 +80,8 @@ set(plugin_HDR ...@@ -86,6 +80,8 @@ set(plugin_HDR
# Create shared library # Create shared library
add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR}) add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR})
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
target_include_directories(${ProjectName} PUBLIC target_include_directories(${ProjectName} PUBLIC
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}
...@@ -123,7 +119,7 @@ else() ...@@ -123,7 +119,7 @@ else()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
endif() endif()
...@@ -131,7 +127,7 @@ endif() ...@@ -131,7 +127,7 @@ endif()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
...@@ -146,13 +142,6 @@ add_custom_command( ...@@ -146,13 +142,6 @@ add_custom_command(
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
POST_BUILD POST_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --assemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName}
COMMENT "Generating JPL archive"
)
add_custom_command(
TARGET ${ProjectName}
POST_BUILD
COMMAND python3 ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName}
COMMENT "Generating JPL archive" COMMENT "Generating JPL archive"
) )
...@@ -72,6 +72,7 @@ add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR}) ...@@ -72,6 +72,7 @@ add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR})
find_package(OpenCV REQUIRED) find_package(OpenCV REQUIRED)
#onnxruntime is not supported by find_package yet, use https://medium.com/@massimilianoriva96/onnxruntime-integration-with-ubuntu-and-cmake-5d7af482136a #onnxruntime is not supported by find_package yet, use https://medium.com/@massimilianoriva96/onnxruntime-integration-with-ubuntu-and-cmake-5d7af482136a
find_package(onnxruntime REQUIRED) find_package(onnxruntime REQUIRED)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
list(APPEND EXTRA_LIBS ${OpenCV_LIBS} ${onnxruntime_LIBS}) list(APPEND EXTRA_LIBS ${OpenCV_LIBS} ${onnxruntime_LIBS})
list(APPEND EXTRA_INCLUDES ${OpenCV_INCLUDE_DIRS} ${onnxruntime_INCLUDE_DIRS}) list(APPEND EXTRA_INCLUDES ${OpenCV_INCLUDE_DIRS} ${onnxruntime_INCLUDE_DIRS})
...@@ -118,7 +119,7 @@ else() ...@@ -118,7 +119,7 @@ else()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
endif() endif()
...@@ -126,7 +127,7 @@ endif() ...@@ -126,7 +127,7 @@ endif()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
...@@ -148,6 +149,6 @@ add_custom_command( ...@@ -148,6 +149,6 @@ add_custom_command(
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
POST_BUILD POST_BUILD
COMMAND python3 ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName}
COMMENT "Generating JPL archive" COMMENT "Generating JPL archive"
) )
...@@ -72,6 +72,7 @@ add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR}) ...@@ -72,6 +72,7 @@ add_library(${ProjectName} SHARED ${plugin_SRC} ${plugin_HDR})
# Find packages # Find packages
find_package(OpenCV REQUIRED) find_package(OpenCV REQUIRED)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
list(APPEND EXTRA_LIBS ${OpenCV_LIBS}) list(APPEND EXTRA_LIBS ${OpenCV_LIBS})
list(APPEND EXTRA_INCLUDES ${OpenCV_INCLUDE_DIRS}) list(APPEND EXTRA_INCLUDES ${OpenCV_INCLUDE_DIRS})
...@@ -117,7 +118,7 @@ else() ...@@ -117,7 +118,7 @@ else()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
endif() endif()
...@@ -125,7 +126,7 @@ endif() ...@@ -125,7 +126,7 @@ endif()
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
PRE_BUILD PRE_BUILD
COMMAND python3 ${PROJECT_SOURCE_DIR}/../SDK/jplManipulation.py --preassemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --preassemble --plugin=${ProjectName}
COMMENT "Assembling Plugin files" COMMENT "Assembling Plugin files"
) )
...@@ -140,6 +141,6 @@ add_custom_command( ...@@ -140,6 +141,6 @@ add_custom_command(
add_custom_command( add_custom_command(
TARGET ${ProjectName} TARGET ${ProjectName}
POST_BUILD POST_BUILD
COMMAND python3 ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName} COMMAND ${Python3_EXECUTABLE} ${SDK_PATH}/jplManipulation.py --assemble --plugin=${ProjectName}
COMMENT "Generating JPL archive" COMMENT "Generating JPL archive"
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment