*/}}
Browse Source

Install and update

YimingWu 1 year ago
parent
commit
7a9800820d
3 changed files with 26 additions and 5 deletions
  1. 18 5
      CMakeLists.txt
  2. 8 0
      GenerateAppimage.py
  3. BIN
      default_brushes.udf

+ 18 - 5
CMakeLists.txt

@@ -1,8 +1,11 @@
 cmake_minimum_required(VERSION 3.1)
 project(OurPaint)
 
-set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
+IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/OurPaint CACHE PATH "Where to install Our Paint" FORCE)
+ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
+set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
 include (InstallRequiredSystemLibraries)
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
@@ -70,13 +73,21 @@ target_link_libraries(OurPaint
     ${LCMS2_LIBRARIES}
 )
 
-SET(LAGUI_FONT_CUSTOM_PATH  $ENV{HOME}/.local/share/fonts/lagui CACHE STRING "Where to install lagui fonts")
+SET(INSTALL_EXTRAS
+    README.md default_brushes.udf COPYING COPYING_CC_BY_NC)
+
+SET(LAGUI_FONT_CUSTOM_PATH  $ENV{HOME}/.local/share/fonts/lagui CACHE STRING "Where to find lagui fonts")
 
 if (NOT DEFINED ${LAGUI_FONT_CUSTOM_PATH})
     set(LAGUI_FONT_CUSTOM_PATH $ENV{HOME}/.local/share/fonts/lagui)
 endif()
 
-install(TARGETS OurPaint RUNTIME_DEPENDENCY_SET runtime_deps DESTINATION ".")
+set(INSTALL_PATH_BIN ".")
+
+if(${CMAKE_VERSION} VERSION_LESS "3.21")
+install(TARGETS OurPaint DESTINATION ${INSTALL_PATH_BIN})
+else()
+install(TARGETS OurPaint RUNTIME_DEPENDENCY_SET runtime_deps DESTINATION ${INSTALL_PATH_BIN})
 LIST(APPEND pre_exclude_regexes "api-ms-.*")
 LIST(APPEND pre_exclude_regexes "ext-ms-.*")
 LIST(APPEND post_exclude_regexes ".*WINDOWS[\\/]system32.*")
@@ -84,6 +95,8 @@ LIST(APPEND post_exclude_regexes "^/lib" "^/usr" "^/bin")
 install(RUNTIME_DEPENDENCY_SET runtime_deps
     PRE_EXCLUDE_REGEXES ${pre_exclude_regexes}
     POST_EXCLUDE_REGEXES ${post_exclude_regexes}
-    DESTINATION "."
+    DESTINATION ${INSTALL_PATH_BIN}
 )
-install(DIRECTORY "${LAGUI_FONT_CUSTOM_PATH}/" DESTINATION "fonts" PATTERN "*.*")
+endif()
+install(DIRECTORY "${LAGUI_FONT_CUSTOM_PATH}/" DESTINATION ${INSTALL_PATH_BIN}/fonts PATTERN "*.*")
+install(FILES ${INSTALL_EXTRAS} DESTINATION ${INSTALL_PATH_BIN})

+ 8 - 0
GenerateAppimage.py

@@ -47,8 +47,15 @@ AppImage:
 script="appimage-builder --recipe AppImageBuilder.yml"
 
 os.system("rm -rf ../OurPaintApp/AppDir")
+os.system("rm -rf ../OurPaintApp/OurPaint")
 os.system("mkdir -p ../OurPaintApp/AppDir")
+os.system("mkdir -p ../OurPaintApp/OurPaint/fonts")
 os.system("cp build/OurPaint ../OurPaintApp/AppDir")
+os.system("cp README.md ../OurPaintApp/OurPaint")
+os.system("cp default_brushes.udf ../OurPaintApp/OurPaint")
+os.system("cp COPYING ../OurPaintApp/OurPaint")
+os.system("cp COPYING_CC_BY_NC ../OurPaintApp/OurPaint")
+os.system("cp %s/.local/share/fonts/lagui/*.* ../OurPaintApp/OurPaint/fonts"%os.path.expanduser("~"))
 
 additional=""
 # bundle everything?
@@ -63,6 +70,7 @@ additional="""
     - liblcms2-2
     - libpng16-16
     - libglew2.1
+    - libxi6
 """
 template=template.replace("---includes---",additional)
 

BIN
default_brushes.udf