Skip to content

Commit

Permalink
added custom target to copy over camera.plugin files on ninja install…
Browse files Browse the repository at this point in the history
… solves #3834 (#4769)

* added cutom target to copy over camera.plugin files on ninja install

* changed how script is being called and how cmake interacts with it
  • Loading branch information
gsn9 authored Feb 7, 2022
1 parent 77cf5d9 commit 2681ffe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,13 @@ add_custom_target(export ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/export/* ${CMAKE_BINARY_DIR}/appdata/export)
add_dependencies(isis export)

# Create the updateBuildPlugins.sh.in file
configure_file(${CMAKE_SOURCE_DIR}/cmake/updateBuildPlugins.sh.in ${CMAKE_BINARY_DIR}/scripts/updateBuildPlugins.sh)

# Add custom build target to copy modified Camera.plugin files to the build/lib/Camera.plugin file
add_custom_target(cameraPlugins ALL COMMAND ${CMAKE_BINARY_DIR}/scripts/updateBuildPlugins.sh)
add_dependencies(isis cameraPlugins)

# Add a custom build target to clean out everything that gets added to the source
# directory during the build process.
# - Only a few things are added in order to make the tests work properly so
Expand All @@ -593,6 +600,7 @@ install(FILES ${CMAKE_SOURCE_DIR}/../AUTHORS.rst DESTINATION ${CMAKE_INSTA
install(FILES ${CMAKE_SOURCE_DIR}/../CHANGELOG.md DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_BINARY_DIR}/version DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts DESTINATION ${CMAKE_INSTALL_PREFIX})
install(PROGRAMS ${CMAKE_BINARY_DIR}/lib/Camera.plugin DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/)

# Trigger all post-install behavior.
# - The only way to run commands post-install in CMake is to add a subdirectory at
Expand Down
3 changes: 0 additions & 3 deletions isis/cmake/AddIsisModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ function(add_isis_obj folder reqLibs)
# Append the plugin file to a single file in the build directory
# where the .so files will be created. During installation copy these
# plugin files to the installation library folder.
set(pluginPath ${CMAKE_BINARY_DIR}/lib/${pluginName})
cat(${plugins} ${pluginPath})
install(PROGRAMS ${pluginPath} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/)
# Record this library name for the caller
set(newPluginLib ${libName} PARENT_SCOPE)
endif()
Expand Down
7 changes: 7 additions & 0 deletions isis/cmake/updateBuildPlugins.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> ${CMAKE_BINARY_DIR}/lib/Camera.plugin
for i in find ${CMAKE_SOURCE_DIR}/src/*/objs/*/Camera.plugin
do
if test -f "$i"; then
cat "$i" >> ${CMAKE_BINARY_DIR}/lib/Camera.plugin
fi
done

0 comments on commit 2681ffe

Please sign in to comment.