Skip to content

Commit 540b7c8

Browse files
bakpaulfredroy
authored andcommitted
Fix installation of ini file + add more insight in informations
1 parent 60eb229 commit 540b7c8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

SofaGLFW/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ add_definitions("-DSOFAGLFW_RESOURCES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/resource
9494
sofa_find_package(FFMPEG_exec BOTH_SCOPES)
9595
# FFMPEG
9696
if(FFMPEG_EXEC_FOUND)
97-
install(PROGRAMS "${FFMPEG_EXEC_FILE}" DESTINATION bin COMPONENT applications)
97+
install(PROGRAMS "${FFMPEG_EXEC_FILE}" DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT applications)
9898
endif()
9999

100100
# Create build and install versions of .ini file for resources finding
@@ -106,7 +106,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/etc/${PROJECT_NAME}.ini.in "${CMAKE_B
106106
get_filename_component(FFMPEG_EXEC_FILENAME "${FFMPEG_EXEC_FILE}" NAME)
107107
set(FFMPEG_EXEC_PATH "../bin/${FFMPEG_EXEC_FILENAME}") # relative path for install dir, see .ini file
108108
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/etc/${PROJECT_NAME}.ini.in "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini")
109-
install(FILES "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini" DESTINATION etc RENAME ${PROJECT_NAME}.ini COMPONENT applications)
109+
install(FILES "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini" DESTINATION ${CMAKE_INSTALL_PREFIX}/etc RENAME ${PROJECT_NAME}.ini COMPONENT applications)
110110

111111

112112

SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,14 @@ bool SofaGLFWBaseGUI::initRecorder(int width, int height, unsigned int framerate
12281228
if (iniFileValues.find("FFMPEG_EXEC_PATH") != iniFileValues.end())
12291229
{
12301230
// get absolute path of FFMPEG executable
1231+
msg_info("SofaGLFWBaseGUI") << " The file " << ffmpegIniFilePath << " points to " << ffmpeg_exec_path << " for the ffmpeg executable.";
12311232
ffmpeg_exec_path = sofa::helper::system::SetDirectory::GetRelativeFromProcess(iniFileValues["FFMPEG_EXEC_PATH"].c_str());
12321233
}
1234+
else
1235+
{
1236+
msg_warning("SofaGLFWBaseGUI") << " The file " << Utils::getSofaPathPrefix() <<"/etc/SofaGLFW.ini either doesn't exist or doesn't contain the string FFMPEG_EXEC_PATH."
1237+
" The initialization of the FFMPEG video recorder will likely fail. To fix this, provide a valid path to the ffmpeg executable inside this file using the syntax \"FFMPEG_EXEC_PATH=/usr/bin/ffmpeg\".";
1238+
}
12331239

12341240
const std::string videoFilename = m_videoRecorderFFMPEG.findFilename(framerate, bitrate / 1024, codecExtension);
12351241

0 commit comments

Comments
 (0)