Browse Source

Merge pull request #318 from djeada/copilot/prep-cmake-for-packaging

Add CMake install rules and binary output directory for packaging
Adam Djellouli 1 month ago
parent
commit
ec801133dd
2 changed files with 11 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 10 0
      CMakeLists.txt

+ 1 - 0
.gitignore

@@ -58,3 +58,4 @@ compile_commands.json
 # Build directories
 build/
 build-*/
+dist/

+ 10 - 0
CMakeLists.txt

@@ -159,6 +159,16 @@ else()
     target_link_libraries(standard_of_iron PRIVATE Qt5::QuickControls2)
 endif()
 
+set_target_properties(standard_of_iron PROPERTIES
+  RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+)
+if (WIN32)
+  set_target_properties(standard_of_iron PROPERTIES WIN32_EXECUTABLE TRUE)
+endif()
+
+install(TARGETS standard_of_iron RUNTIME DESTINATION .)
+install(DIRECTORY assets/ DESTINATION assets)
+
 # Copy assets next to the binary for dev runs
 file(COPY assets/ DESTINATION ${CMAKE_BINARY_DIR}/assets/)