ENH: Propagate system name and handle win32/win64 name

This commit is contained in:
Andy Cedilnik 2006-04-23 19:45:43 -04:00
parent f33480937c
commit 4e9564a0f1
2 changed files with 15 additions and 3 deletions

View File

@ -52,9 +52,19 @@ IF(CPACK_NSIS_MODIFY_PATH)
SET(CPACK_NSIS_MODIFY_PATH ON) SET(CPACK_NSIS_MODIFY_PATH ON)
ENDIF(CPACK_NSIS_MODIFY_PATH) ENDIF(CPACK_NSIS_MODIFY_PATH)
SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
IF(${__cpack_system_name} MATCHES Windows)
IF(CMAKE_CL_64)
SET(__cpack_system_name win64)
ELSE(CMAKE_CL_64)
SET(__cpack_system_name win32)
ENDIF(CMAKE_CL_64)
ENDIF(${__cpack_system_name} MATCHES Windows)
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype> # <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype>
cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}") "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CPACK_SYSTEM_NAME}")
cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
"${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
@ -89,7 +99,7 @@ ENDIF(NOT CPACK_GENERATOR)
cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/") "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}") cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CMAKE_SYSTEM_NAME}") cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
cpack_encode_variables() cpack_encode_variables()
CONFIGURE_FILE("${cpack_input_file}" CONFIGURE_FILE("${cpack_input_file}"
@ -98,7 +108,7 @@ CONFIGURE_FILE("${cpack_input_file}"
# Generate source file # Generate source file
cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES
"${CMAKE_SOURCE_DIR};/") "${CMAKE_SOURCE_DIR};/")
cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CMAKE_SYSTEM_NAME}-Source") cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source")
cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-Source") "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-Source")
cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES

View File

@ -134,6 +134,7 @@ Function AddToPath
Goto AddToPath_done Goto AddToPath_done
AddToPath_NT: AddToPath_NT:
MessageBox MB_OK 'Add to path "$0"'
ReadRegStr $1 SHCTX "Environment" "PATH" ReadRegStr $1 SHCTX "Environment" "PATH"
StrCpy $2 $1 1 -1 # copy last char StrCpy $2 $1 1 -1 # copy last char
StrCmp $2 ";" 0 +2 # if last char == ; StrCmp $2 ";" 0 +2 # if last char == ;
@ -202,6 +203,7 @@ Function un.RemoveFromPath
Goto unRemoveFromPath_done Goto unRemoveFromPath_done
unRemoveFromPath_NT: unRemoveFromPath_NT:
MessageBox MB_OK 'Remove from path "$0"'
ReadRegStr $1 SHCTX "Environment" "PATH" ReadRegStr $1 SHCTX "Environment" "PATH"
StrCpy $5 $1 1 -1 # copy last char StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ; StrCmp $5 ";" +2 # if last char != ;