diff --git a/SofaGLFW/CMakeLists.txt b/SofaGLFW/CMakeLists.txt index 695bb3f938..a8368a7458 100644 --- a/SofaGLFW/CMakeLists.txt +++ b/SofaGLFW/CMakeLists.txt @@ -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) diff --git a/SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp b/SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp index 56274d059b..4585ead12c 100644 --- a/SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp +++ b/SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp @@ -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 {