@ -13,10 +13,17 @@
# Y o u s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e
# Y o u s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e
# a l o n g w i t h K o r m a n . I f n o t , s e e < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > .
# a l o n g w i t h K o r m a n . I f n o t , s e e < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > .
# N S I S b l o w s u p i f y o u g i v e i t CMake ( read: unix-like ) p a t h s o n W i n d o w s .
function ( set_native_path OUT_VAR PATH_STRING )
file ( TO_NATIVE_PATH "${PATH_STRING}" _temp )
string ( REPLACE "\\" "\\\\" _temp "${_temp}" )
set ( ${ OUT_VAR } "${_temp}" PARENT_SCOPE )
endfunction ( )
set ( CPACK_PACKAGE_NAME Korman )
set ( CPACK_PACKAGE_NAME Korman )
set ( CPACK_PACKAGE_VENDOR "Guild of Writers" )
set ( CPACK_PACKAGE_VENDOR "Guild of Writers" )
set ( CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/package" )
set ( CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/package" )
set ( CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/installer/Icon.ico" )
set_native_path ( CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/installer/Icon.ico" )
set ( CPACK_THREADS 0 ) # A l l o w s m u l t i - t h r e a d e d L Z M A c o m p r e s s i o n i n C M a k e 3 . 2 1 +
set ( CPACK_THREADS 0 ) # A l l o w s m u l t i - t h r e a d e d L Z M A c o m p r e s s i o n i n C M a k e 3 . 2 1 +
find_package ( Git )
find_package ( Git )
@ -73,32 +80,67 @@ install(FILES
set ( CPACK_COMPONENTS_ALL "Korman" )
set ( CPACK_COMPONENTS_ALL "Korman" )
set ( CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE" )
set ( CPACK_COMPONENTS_GROUPING "ALL_COMPONENTS_IN_ONE" )
set ( CPACK_COMPONENT_KORMAN_HIDDEN TRUE )
set ( CPACK_COMPONENT_KORMAN_REQUIRED TRUE )
if ( korman_INSTALL_BLENDER )
if ( korman_INSTALL_BLENDER )
list ( APPEND CPACK_PACKAGE_EXECUTABLES blender Blender )
list ( APPEND CPACK_PACKAGE_EXECUTABLES blender Blender )
list ( APPEND CPACK_COMPONENTS_ALL "Blender" )
list ( APPEND CPACK_COMPONENTS_ALL "Blender" )
set ( CPACK_COMPONENT_BLENDER_HIDDEN TRUE )
set ( CPACK_COMPONENT_BLENDER_REQUIRED TRUE )
endif ( )
endif ( )
if ( korman_HARVEST_PYTHON22 )
if ( korman_HARVEST_PYTHON22 )
list ( APPEND CPACK_COMPONENTS_ALL "Python22" )
list ( APPEND CPACK_COMPONENTS_ALL "Python22" )
set ( CPACK_COMPONENT_PYTHON22_HIDDEN TRUE )
endif ( )
endif ( )
if ( WIN32 )
if ( WIN32 )
# W e ' r e n o t a c t u a l l y g o i n g t o s h i p t h i s v a r i a n t , b u t b e t t e r p r e p a r e d t h a n s o r r y .
set ( CPACK_NSIS_COMPRESSOR "/SOLID lzma" )
if ( korman_HARVEST_VCREDIST )
set ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS
set_native_path ( CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/installer/Icon.ico" )
" E x e c W a i t \ \ \ " $ I N S T D I R \ \ \ \ $ { V C R e d i s t _ N A M E } / q / n o r e s t a r t \ \ \ " "
set_native_path ( CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${PROJECT_SOURCE_DIR}/installer/WelcomeFinish.bmp" )
set_native_path ( CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${PROJECT_SOURCE_DIR}/installer/WelcomeFinish.bmp" )
set_native_path ( CPACK_NSIS_MUI_HEADERIMAGE "${PROJECT_SOURCE_DIR}/installer/Header.bmp" )
function ( add_nsis_install_commands )
cmake_parse_arguments (
P A R S E _ A R G V 0
_ a n i c
" P R E ; P O S T "
" "
" C O M M A N D S "
)
)
if ( _anic_PRE )
set ( _var CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS )
elseif ( _anic_POST )
set ( _var CPACK_NSIS_EXTRA_INSTALL_COMMANDS )
else ( )
message ( FATAL_ERROR "add_nsis_install_command() requires PRE or POST to be specified!" )
endif ( )
foreach ( _command IN LISTS _anic_COMMANDS )
set ( ${ _var } "${${_var}}\n${_command}" PARENT_SCOPE )
endforeach ( )
endfunction ( )
if ( korman_HARVEST_PYTHON22 )
add_nsis_install_commands ( POST COMMANDS [[ExecWait \"$INSTDIR\\Python_2.2.3.exe /S\ " ]] )
endif ( )
endif ( )
if ( korman_HARVEST_VCREDIST )
add_nsis_install_commands ( POST COMMANDS "ExecWait \\\" $ INSTDIR\\\\ ${ VCRedist_NAME } /q /norestart\\\ "" )
endif ( )
# R e g i s t e r t h e . b l e n d f i l e e x t e n s i o n w i t h t h i s t h i n g y .
add_nsis_install_commands ( POST COMMANDS [[ExecWait \"$INSTDIR\\blender.exe -r\ " ]] )
# T h e l i c e n s e p a g e i s j u s t t h e G N U G P L , w h i c h i s a d i s t r i b u t i o n l i c e n s e , n o t a n E U L A .
set ( CPACK_NSIS_IGNORE_LICENSE_PAGE TRUE )
set ( CPACK_WIX_UPGRADE_GUID 84ef4b1d-27b6-54de-a73b-8fb1beb007ac ) # K o r m a n U p g r a d e
set ( CPACK_WIX_UPGRADE_GUID 84ef4b1d-27b6-54de-a73b-8fb1beb007ac ) # K o r m a n U p g r a d e
# I t h i n k t h i s s h o u l d b e r a n d o m i z e d b y C P a c k a n d n o t h a r d c o d e d ?
# I t h i n k t h i s s h o u l d b e r a n d o m i z e d b y C P a c k a n d n o t h a r d c o d e d ?
# set ( CPACK_WIX_PRODUCT_GUID 74e91f5d-6d09-5d7f-a48f-3d0b011ef2df ) # K o r m a n P r o d u c t
# set ( CPACK_WIX_PRODUCT_GUID 74e91f5d-6d09-5d7f-a48f-3d0b011ef2df ) # K o r m a n P r o d u c t
find_package ( VCRedist COMPONENTS MergeModules REQUIRED )
if ( CPACK_BINARY_WIX )
set ( _msm_required REQUIRED )
endif ( )
find_package ( VCRedist COMPONENTS MergeModules ${ _msm_required } )
configure_file (
configure_file (
" $ { P R O J E C T _ S O U R C E _ D I R } / i n s t a l l e r / W i X . t e m p l a t e . i n "
" $ { P R O J E C T _ S O U R C E _ D I R } / i n s t a l l e r / W i X . t e m p l a t e . i n "
" $ { P R O J E C T _ B I N A R Y _ D I R } / W i X . t e m p l a t e "
" $ { P R O J E C T _ B I N A R Y _ D I R } / W i X . t e m p l a t e "