[CMake] CPACK installation path configuration

Hans Johnson hans.j.johnson at gmail.com
Tue Jul 22 16:51:46 EDT 2008


Hello,

I¹ve been trying to figure out how to use CPACK to distribute my package as
a dmg, rpm, and tar.gz files.  I¹ve been able to successfully create the
files, but the locations where the resulting files are being put are not as
desired.

I¹d like the resulting binary to be installed in
/opt/BRAINSFit/bin/BRAINSFit
Currently PackageMaker installs in /opt/BRAINSFit/usr/bin/BRAINSFit and RPM
installs in /usr/bin/BRAINSFit.

The  CMakeList.txt files are included in my previous message.

Any help or suggestions on what to try would be enormously appreciated.

Thanks,
Hans



From: Johnson Hans <hans-johnson at uiowa.edu>
Date: Sat, 19 Jul 2008 12:29:48 -0500
To: <cmake at cmake.org>
Subject: CPACK installation path configuration

Hello,

I am trying to use cpack to create distributions of a project available on
NITRC:
svn checkout https://www.nitrc.org/svn/multimodereg BRAINSFit

I¹d like the resulting binary to be installed in
/opt/BRAINSFit/bin/BRAINSFit

Currently PackageMaker installs in /opt/BRAINSFit/usr/bin/BRAINSFit and RPM
installs in /usr/bin/BRAINSFit.

Can someone please help me fix my CPACK variables so that the desired
install locations are respected?

======
I¹m using CMake 2.6.0

Any other advise about CPACK style issues would also be appreciated because
I¹ll be repeating this process for several other packages next week.

Thanks,
Hans

====CMakeLists.txt====
PROJECT(BRAINSFit)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)

INCLUDE(${BRAINSFit_SOURCE_DIR}/IJMacros.txt)

#the following are required to uses Dart
ENABLE_TESTING()
INCLUDE(Dart)

#---------------------------------------------------------------------------
--
# Output directories.
 IF(NOT LIBRARY_OUTPUT_PATH)
   SET (LIBRARY_OUTPUT_PATH ${BRAINSFit_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all librari
es.")
 ENDIF(NOT LIBRARY_OUTPUT_PATH)
 IF(NOT EXECUTABLE_OUTPUT_PATH)
   SET (EXECUTABLE_OUTPUT_PATH ${BRAINSFit_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all exec
utables.")
 ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
 MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)


OPTION(BUILD_AGAINST_SLICER3 "If OFF, then build self contained version that
only depends on ITK ." OFF)
MARK_AS_ADVANCED(BUILD_AGAINST_SLICER3)

OPTION(BRAINSFit_BUILD_LOCAL_CLP "If ON, then build self contained version
that only depends on ITK ." ON)
MARK_AS_ADVANCED(BRAINSFit_BUILD_LOCAL_CLP)

IF(BUILD_AGAINST_SLICER3)
  FIND_PACKAGE(Slicer3 REQUIRED)
  IF (Slicer3_FOUND)
    INCLUDE(${Slicer3_USE_FILE})
  ELSE (Slicer3_FOUND)
    MESSAGE(ERROR "Cannot build without a Slicer3 build tree or a Slicer3
installation. Please set Slicer3_DIR.")
  ENDIF (Slicer3_FOUND)
ELSE(BUILD_AGAINST_SLICER3)
  FIND_PACKAGE(ITK)
  IF(ITK_FOUND)
    INCLUDE(${ITK_USE_FILE})
  ELSE(ITK_FOUND)
    MESSAGE(FATAL_ERROR
            "Cannot build without ITK.  Please set ITK_DIR.")
  ENDIF(ITK_FOUND)
  IF(BRAINSFit_BUILD_LOCAL_CLP)
    MESSAGE(WARNING "Building local Slicer Execution Model")
CMakeLists.txt     
1,1            Top
"CMakeLists.txt" 144L, 5487C
                 RUNTIME DESTINATION bin
                 LIBRARY DESTINATION lib
                 ARCHIVE DESTINATION lib/static)

INCLUDE(InstallRequiredSystemLibraries)


SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "1")

SET(CPACK_PACKAGE_NAME "BRAINSFit")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${BRAINSFit}-dev")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${BRAINSFit}-A program for medical
image registraiton with mutual information met
ric.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${BRAINSFit_SOURCE_DIR}/ReadMe.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${BRAINSFit_SOURCE_DIR}/Copyright.txt")

SET(CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${BRAINSFit}")

SET(CPACK_PACKAGE_VENDOR "NAMIC Tool Developed at The University of Iowa")

SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
#SET(CPACK_SOURCE_IGNORE_FILES "/CVS/;/\\.svn/;\\.swp$;\\.#;/#;\\.*~")
SET(CPACK_SOURCE_IGNORE_FILES "")
  SET(CPACK_PACKAGE_EXECUTABLES "BRAINSFit";"A program for registering
medical images with mutual information.")

IF(WIN32 AND NOT UNIX)
  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
N_M
INOR}.${CPACK_PACKAGE_VERSION_PATCH}")
  # There is a bug in NSI that does not handle full unix paths properly.
Make
  # sure there is at least one set of four (4) backlasshes.
  SET(CPACK_PACKAGE_ICON
"${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous
Project")
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.nitrc.org")
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.nitrc.org")
  SET(CPACK_NSIS_CONTACT "hans-johnson at uiowa.edu")
  SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
  SET(CPACK_STRIP_FILES OFF)
  SET(CPACK_SOURCE_STRIP_FILES OFF)
ENDIF(WIN32 AND NOT UNIX)

INCLUDE(CPack)     



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080722/7ce21d94/attachment-0001.htm>


More information about the CMake mailing list