build: Set up cmake 'install' build target

The 'install' build target creates a self-contained (deployable) sparkd
package. It copies the sparkd executable and its dependencies into a
single directory (no symlinks), which can then be copied/deployed to
another machine.

Run `cmake --build . --target install` to install sparkd in the
directory defined by the CMAKE_INSTALL_PREFIX variable.
This commit is contained in:
John Colvin committed 2023-01-05 14:03:40 -05:00
1 parent b96612d37b
commit feaad6335d
4 files changed
+9 -1

No files matched your search

+3
View File
@@ -70,4 +70,7 @@ else ()
DEPENDS sparkd data_files_dir) DEPENDS sparkd data_files_dir)
add_custom_target(server_layout ALL DEPENDS ${CMAKE_BINARY_DIR}/server) add_custom_target(server_layout ALL DEPENDS ${CMAKE_BINARY_DIR}/server)
install(FILES "${CMAKE_SOURCE_DIR}/externals/linux/lib/${CMAKE_BUILD_TYPE}/libACE-5.7.5.so" DESTINATION bin)
install(FILES "${CMAKE_SOURCE_DIR}/externals/linux/lib/${CMAKE_BUILD_TYPE}/libOnixS.IceImpactMulticastPriceFeedHandlerCpp.so.3.16.0.0" DESTINATION bin)
endif() endif()
+3 -1
View File
@@ -135,7 +135,9 @@ else ()
-ldl -ldl
-static-libgcc -static-libgcc
-static-libstdc++ -static-libstdc++
-pthread) -pthread)
install(TARGETS libspark DESTINATION bin)
endif() endif()
if (WIN32) if (WIN32)
+2
View File
@@ -41,3 +41,5 @@ target_link_libraries( sparkd
add_custom_command(TARGET sparkd POST_BUILD add_custom_command(TARGET sparkd POST_BUILD
COMMAND ln -fs ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_CURRENT_BINARY_DIR}) COMMAND ln -fs ${CMAKE_BINARY_DIR}/src/lib/libspark.so ${CMAKE_CURRENT_BINARY_DIR})
install(TARGETS sparkd DESTINATION bin)
+1
View File
@@ -32,3 +32,4 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/web/ui/bundle.js
add_custom_target(web_ui_bundle ALL DEPENDS ${CMAKE_BINARY_DIR}/web/ui/bundle.js) add_custom_target(web_ui_bundle ALL DEPENDS ${CMAKE_BINARY_DIR}/web/ui/bundle.js)
install(DIRECTORY "${CMAKE_BINARY_DIR}/web" DESTINATION bin)