Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions SofaGLFW/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,19 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/etc/${PROJECT_NAME}.ini.in "${CMAKE_B

#### For install tree
get_filename_component(FFMPEG_EXEC_FILENAME "${FFMPEG_EXEC_FILE}" NAME)
set(FFMPEG_EXEC_PATH "../bin/${FFMPEG_EXEC_FILENAME}") # relative path for install dir, see .ini file
if(FFMPEG_EXEC_FILENAME)
set(FFMPEG_EXEC_PATH "../bin/${FFMPEG_EXEC_FILENAME}")
else()
#If ffmpeg hasn't been found, it'll not be shipped but we still want to offer the possibility for the user to use it
#easily by putting the executable alongside runSofa
set(FFMPEG_EXEC_PATH "../bin/ffmpeg")
if(WIN32)
set(FFMPEG_EXEC_PATH "${FFMPEG_EXEC_PATH}.exe")
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/etc/${PROJECT_NAME}.ini.in "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini")
install(FILES "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini" DESTINATION ${CMAKE_INSTALL_PREFIX}/etc RENAME ${PROJECT_NAME}.ini COMPONENT applications)
#Hack relative tree to ../../etc because of Windows:NSIS that doesn't allow absolute install path.
install(FILES "${CMAKE_BINARY_DIR}/etc/installed${PROJECT_NAME}.ini" DESTINATION ../../etc RENAME ${PROJECT_NAME}.ini COMPONENT applications)



Expand Down
2 changes: 1 addition & 1 deletion SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,8 +1228,8 @@ bool SofaGLFWBaseGUI::initRecorder(int width, int height, unsigned int framerate
if (iniFileValues.find("FFMPEG_EXEC_PATH") != iniFileValues.end())
{
// get absolute path of FFMPEG executable
msg_info("SofaGLFWBaseGUI") << " The file " << ffmpegIniFilePath << " points to " << ffmpeg_exec_path << " for the ffmpeg executable.";
ffmpeg_exec_path = sofa::helper::system::SetDirectory::GetRelativeFromProcess(iniFileValues["FFMPEG_EXEC_PATH"].c_str());
msg_info("SofaGLFWBaseGUI") << " The file " << ffmpegIniFilePath << " points to " << ffmpeg_exec_path << " for the ffmpeg executable.";
}
else
{
Expand Down
Loading