Skip to content

Commit

Permalink
Move install command to function
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Sep 24, 2024
1 parent 9371b1d commit 18d7973
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
13 changes: 3 additions & 10 deletions ExampleDependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION Plugins COMPONENT PLUGINS # Linux/Mac .so
)

include(cmake/install_dependencies_utils.cmake)
install_dependencies(${PROJECT_NAME} "hwy" "hwy_contrib")

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Installing: Plugin files"
COMMAND "${CMAKE_COMMAND}"
Expand All @@ -120,15 +117,11 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
--component PLUGINS
--prefix ${ManiVault_INSTALL_DIR}/$<CONFIGURATION>
--verbose
COMMAND ${CMAKE_COMMAND} -E echo "Installing: Plugin dependencies"
COMMAND "${CMAKE_COMMAND}"
--install ${CMAKE_CURRENT_BINARY_DIR}
--config $<CONFIGURATION>
--component DEP_PLUGIN_PRINT
--prefix ${ManiVault_INSTALL_DIR}/$<CONFIGURATION>
--verbose
)

include(cmake/install_dependencies_utils.cmake)
install_dependencies(${PROJECT_NAME} "hwy" "hwy_contrib")

# -----------------------------------------------------------------------------
# Miscellaneous
# -----------------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions ExampleDependencies/cmake/install_dependencies.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
install(CODE [[

if(WIN32)
set(PRE_EXCLUDE ".*[\\/]api-ms.*" ".*[\\/]ext-ms.*" ".*[\\/]hvsi.*" ".*[\\/]pdmutilities.*" ".*[\\/]wpaxholder.*" ".*[\\/]dxgi.*" ".*[\\/]uxtheme.*" ".*[\\/]d3d11.*" ".*[\\/]winmm.*" ".*[\\/]wldp.*")
set(PRE_EXCLUDE ".*[\\/]qt.*" ".*[\\/]api-ms.*" ".*[\\/]ext-ms.*" ".*[\\/]hvsi.*" ".*[\\/]pdmutilities.*" ".*[\\/]wpaxholder.*" ".*[\\/]dxgi.*" ".*[\\/]uxtheme.*" ".*[\\/]d3d11.*" ".*[\\/]winmm.*" ".*[\\/]wldp.*")
set(POST_EXCLUDE ".*[\\/]system32[\\/].*\\.dll")
elseif(APPLE)
set(PRE_EXCLUDE "/usr/lib" "/System/")
Expand Down Expand Up @@ -36,6 +36,9 @@ install(CODE [[

foreach(FILE ${RESOLVED_DEPS})
message(STATUS "Resolved: ${FILE}")
endforeach()

foreach(FILE ${RESOLVED_DEPS})
install_deps(${FILE})
endforeach()

Expand All @@ -51,5 +54,5 @@ install(CODE [[
endif()

]]
COMPONENT DEP_PLUGIN_PRINT
COMPONENT PLUGIN_DEPENDENCIES
)
11 changes: 11 additions & 0 deletions ExampleDependencies/cmake/install_dependencies_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,15 @@ function(install_dependencies main_target)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/install_dependencies.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/install_dependencies.cmake" @ONLY)

include(cmake/install_dependencies.cmake)

add_custom_command(TARGET ${main_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Installing: Plugin dependencies"
COMMAND "${CMAKE_COMMAND}"
--install ${CMAKE_CURRENT_BINARY_DIR}
--config $<CONFIGURATION>
--component PLUGIN_DEPENDENCIES
--prefix ${ManiVault_INSTALL_DIR}/$<CONFIGURATION>
--verbose
)

endfunction()

0 comments on commit 18d7973

Please sign in to comment.