<HTML>
<HEAD>
<TITLE>Re: CPACK installation path configuration</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
I&#8217;ve been trying to figure out how to use CPACK to distribute my package as a dmg, rpm, and tar.gz files. &nbsp;I&#8217;ve been able to successfully create the files, but the locations where the resulting files are being put are not as desired.<BR>
<BR>
I&#8217;d like the resulting binary to be installed in /opt/BRAINSFit/bin/BRAINSFit<BR>
Currently PackageMaker installs in /opt/BRAINSFit/usr/bin/BRAINSFit and RPM installs in /usr/bin/BRAINSFit.<BR>
<BR>
The &nbsp;CMakeList.txt files are included in my previous message.<BR>
<BR>
Any help or suggestions on what to try would be enormously appreciated.<BR>
<BR>
Thanks,<BR>
Hans<BR>
<BR>
<BR>
<BR>
<B>From: </B>Johnson Hans &lt;<a href="hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>&gt;<BR>
<B>Date: </B>Sat, 19 Jul 2008 12:29:48 -0500<BR>
<B>To: </B>&lt;<a href="cmake@cmake.org">cmake@cmake.org</a>&gt;<BR>
<B>Subject: </B>CPACK installation path configuration<BR>
<BR>
Hello,<BR>
<BR>
I am trying to use cpack to create distributions of a project available on NITRC:<BR>
svn checkout <FONT COLOR="#0000FF"><U><a href="https://www.nitrc.org/svn/multimodereg">https://www.nitrc.org/svn/multimodereg</a></U></FONT> BRAINSFit<BR>
<BR>
I&#8217;d like the resulting binary to be installed in /opt/BRAINSFit/bin/BRAINSFit<BR>
<BR>
Currently PackageMaker installs in /opt/BRAINSFit/usr/bin/BRAINSFit and RPM installs in /usr/bin/BRAINSFit.<BR>
<BR>
Can someone please help me fix my CPACK variables so that the desired install locations are respected?<BR>
<BR>
======<BR>
I&#8217;m using CMake 2.6.0<BR>
<BR>
Any other advise about CPACK style issues would also be appreciated because I&#8217;ll be repeating this process for several other packages next week.<BR>
<BR>
Thanks,<BR>
Hans<BR>
<BR>
====CMakeLists.txt====<BR>
PROJECT(BRAINSFit)<BR>
cmake_minimum_required(VERSION 2.6)<BR>
cmake_policy(VERSION 2.6)<BR>
<BR>
INCLUDE(${BRAINSFit_SOURCE_DIR}/IJMacros.txt)<BR>
<BR>
#the following are required to uses Dart<BR>
ENABLE_TESTING()<BR>
INCLUDE(Dart)<BR>
<BR>
#-----------------------------------------------------------------------------<BR>
# Output directories.<BR>
&nbsp;IF(NOT LIBRARY_OUTPUT_PATH)<BR>
&nbsp;&nbsp;&nbsp;SET (LIBRARY_OUTPUT_PATH ${BRAINSFit_BINARY_DIR}/bin CACHE INTERNAL &quot;Single output directory for building all librari<BR>
es.&quot;)<BR>
&nbsp;ENDIF(NOT LIBRARY_OUTPUT_PATH)<BR>
&nbsp;IF(NOT EXECUTABLE_OUTPUT_PATH)<BR>
&nbsp;&nbsp;&nbsp;SET (EXECUTABLE_OUTPUT_PATH ${BRAINSFit_BINARY_DIR}/bin CACHE INTERNAL &quot;Single output directory for building all exec<BR>
utables.&quot;)<BR>
&nbsp;ENDIF(NOT EXECUTABLE_OUTPUT_PATH)<BR>
&nbsp;MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)<BR>
<BR>
<BR>
OPTION(BUILD_AGAINST_SLICER3 &quot;If OFF, then build self contained version that only depends on ITK .&quot; OFF)<BR>
MARK_AS_ADVANCED(BUILD_AGAINST_SLICER3)<BR>
<BR>
OPTION(BRAINSFit_BUILD_LOCAL_CLP &quot;If ON, then build self contained version that only depends on ITK .&quot; ON)<BR>
MARK_AS_ADVANCED(BRAINSFit_BUILD_LOCAL_CLP)<BR>
<BR>
IF(BUILD_AGAINST_SLICER3)<BR>
&nbsp;&nbsp;FIND_PACKAGE(Slicer3 REQUIRED)<BR>
&nbsp;&nbsp;IF (Slicer3_FOUND)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;INCLUDE(${Slicer3_USE_FILE})<BR>
&nbsp;&nbsp;ELSE (Slicer3_FOUND)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE(ERROR &quot;Cannot build without a Slicer3 build tree or a Slicer3 installation. Please set Slicer3_DIR.&quot;)<BR>
&nbsp;&nbsp;ENDIF (Slicer3_FOUND)<BR>
ELSE(BUILD_AGAINST_SLICER3)<BR>
&nbsp;&nbsp;FIND_PACKAGE(ITK)<BR>
&nbsp;&nbsp;IF(ITK_FOUND)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;INCLUDE(${ITK_USE_FILE})<BR>
&nbsp;&nbsp;ELSE(ITK_FOUND)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE(FATAL_ERROR<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;Cannot build without ITK. &nbsp;Please set ITK_DIR.&quot;)<BR>
&nbsp;&nbsp;ENDIF(ITK_FOUND)<BR>
&nbsp;&nbsp;IF(BRAINSFit_BUILD_LOCAL_CLP)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE(WARNING &quot;Building local Slicer Execution Model&quot;)<BR>
CMakeLists.txt &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Top<BR>
&quot;CMakeLists.txt&quot; 144L, 5487C<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME DESTINATION bin<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LIBRARY DESTINATION lib<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARCHIVE DESTINATION lib/static)<BR>
<BR>
INCLUDE(InstallRequiredSystemLibraries)<BR>
<BR>
<BR>
SET(CPACK_PACKAGE_VERSION_MAJOR &quot;2&quot;)<BR>
SET(CPACK_PACKAGE_VERSION_MINOR &quot;4&quot;)<BR>
SET(CPACK_PACKAGE_VERSION_PATCH &quot;1&quot;)<BR>
<BR>
SET(CPACK_PACKAGE_NAME &quot;BRAINSFit&quot;)<BR>
SET(CPACK_SOURCE_PACKAGE_FILE_NAME &quot;${BRAINSFit}-dev&quot;)<BR>
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY &quot;${BRAINSFit}-A program for medical image registraiton with mutual information met<BR>
ric.&quot;)<BR>
SET(CPACK_PACKAGE_DESCRIPTION_FILE &quot;${BRAINSFit_SOURCE_DIR}/ReadMe.txt&quot;)<BR>
SET(CPACK_RESOURCE_FILE_LICENSE &quot;${BRAINSFit_SOURCE_DIR}/Copyright.txt&quot;)<BR>
<BR>
SET(CPACK_PACKAGE_DEFAULT_LOCATION &quot;/opt/${CPACK_PACKAGE_NAME}&quot;)<BR>
SET(CPACK_PACKAGE_INSTALL_DIRECTORY &quot;${BRAINSFit}&quot;)<BR>
<BR>
SET(CPACK_PACKAGE_VENDOR &quot;NAMIC Tool Developed at The University of Iowa&quot;)<BR>
<BR>
SET(CPACK_SOURCE_GENERATOR &quot;TGZ;TZ&quot;)<BR>
#SET(CPACK_SOURCE_IGNORE_FILES &quot;/CVS/;/\\.svn/;\\.swp$;\\.#;/#;\\.*~&quot;)<BR>
SET(CPACK_SOURCE_IGNORE_FILES &quot;&quot;)<BR>
&nbsp;&nbsp;SET(CPACK_PACKAGE_EXECUTABLES &quot;BRAINSFit&quot;;&quot;A program for registering medical images with mutual information.&quot;)<BR>
<BR>
IF(WIN32 AND NOT UNIX)<BR>
&nbsp;&nbsp;SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY &quot;${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_M<BR>
INOR}.${CPACK_PACKAGE_VERSION_PATCH}&quot;)<BR>
&nbsp;&nbsp;# There is a bug in NSI that does not handle full unix paths properly. Make<BR>
&nbsp;&nbsp;# sure there is at least one set of four (4) backlasshes.<BR>
&nbsp;&nbsp;SET(CPACK_PACKAGE_ICON &quot;${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp&quot;)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_INSTALLED_ICON_NAME &quot;bin\\\\MyExecutable.exe&quot;)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_DISPLAY_NAME &quot;${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project&quot;)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_HELP_LINK &quot;<FONT COLOR="#0000FF"><U><a href="http:\\\\\\\\www.nitrc.org">http:\\\\\\\\www.nitrc.org</a>&quot;</U></FONT>)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_URL_INFO_ABOUT &quot;<FONT COLOR="#0000FF"><U><a href="http:\\\\\\\\www.nitrc.org">http:\\\\\\\\www.nitrc.org</a>&quot;</U></FONT>)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_CONTACT &quot;<FONT COLOR="#0000FF"><U><a href="hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>&quot;</U></FONT>)<BR>
&nbsp;&nbsp;SET(CPACK_NSIS_MODIFY_PATH ON)<BR>
ELSE(WIN32 AND NOT UNIX)<BR>
&nbsp;&nbsp;SET(CPACK_STRIP_FILES OFF)<BR>
&nbsp;&nbsp;SET(CPACK_SOURCE_STRIP_FILES OFF)<BR>
ENDIF(WIN32 AND NOT UNIX)<BR>
<BR>
INCLUDE(CPack) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>