[CMake] issue with INSTALL and CMAKE_INSTALL_PREFIX

Xavier Delannoy xavier.delannoy at netasq.com
Thu Oct 5 04:35:43 EDT 2006


hi, 

I use CMake 2.4.1 under FreeBSD6.1.

in my CMakeLists.txt (for a shared library) I have : 

SET(CMAKE_INSTALL_PREFIX "$ENV{DESTDIRPREFIX}")
MESSAGE(STATUS "CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}")
INSTALL(TARGETS nbase_shared DESTINATION /usr/Firewall/lib)

...


during CMake execution : 
build Makefile for lib/libnbase
-- Check for working C compiler: gcc
-- Check for working C compiler: gcc -- works
-- Check size of void*
-- Check size of void* - done
-- libnbase
-- CMAKE_INSTALL_PREFIX /home/xavierd/tempbuild/firmware/tmp/bin.FW-M-INTERNE
-- Configuring done

CMAKE_INSTALL_PREFIX is OK, but during the installation process I have : 
Install the project...
/home/xavierd/tempbuild/firmware/contrib/cmake/work/cmake-2.4.1/bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
CMake Error: Error in cmake code at
/home/xavierd/tempbuild/firmware/lib/libnbase/shared/cmake_install.cmake:30:
FILE cannot create directory: /usr/Firewall/lib. Maybe need administrative privileges.
*** Error code 255

here is my cmake_install.cmake
# Install script for directory: /home/xavierd/tempbuild/firmware/lib/libnbase/sh
ared

# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  SET(CMAKE_INSTALL_PREFIX "/home/xavierd/tempbuild/firmware/tmp/bin.FW-M-INTERN
E")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
IF(NOT CMAKE_INSTALL_CONFIG_NAME)
  IF(BUILD_TYPE)
    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
  ELSE(BUILD_TYPE)
    SET(CMAKE_INSTALL_CONFIG_NAME Release)
  ENDIF(BUILD_TYPE)
  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT CMAKE_INSTALL_CONFIG_NAME)

# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
  IF(COMPONENT)
    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
  ELSE(COMPONENT)
    SET(CMAKE_INSTALL_COMPONENT)
  ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)

FILE(INSTALL DESTINATION "/usr/Firewall/lib" TYPE SHARED_LIBRARY FILES "/home/xavierd/tempbuild/firmware/tmp/libnbase.so")
FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/Firewall/lib" TYPE SHARED_
LIBRARY FILES "/home/xavierd/tempbuild/firmware/tmp/libnbase.so")

Why I have 2 FILE(INSTALL ....) ? is this a bug ? 

thanks for your help

-- 
Xavier Delannoy

R&D engineer
xavier.delannoy at netasq.com
http://www.netasq.com
Tél : +33 320 619 742
Fax : +33 320 619 639

-----------------------------------------------------------------------
This communication may contain information that is proprietary, 
privileged or confidential or otherwise legally exempt from disclosure.
The information contained in this e-mail is intended solely for the
addressee. Access to this e-mail by anyone else or any unauthorized
review, use, disclosure or distribution is unauthorized and prohibited.
If you are not the named addressee indicated in this message (or
responsible for delivery of the message to such person), you are not
authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this message in error, please
notify the sender immediately by fax or e-mail and delete and destroy
all copies of the message. If you are the intended recipient but do not
wish to receive communications through this medium, please advise the
sender immediately. The views expressed in this e-mail are not 
necessarily the views of NetASQ. The company, its directors, officers
or employees make no representation or accept any liability for its
accuracy or completeness unless expressly stated to the contrary.
------------------------------------------------------------------------


More information about the CMake mailing list