View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014450CMakeCMakepublic2013-10-01 10:552014-03-05 09:58
Reportergeorgeg 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformLinuxOSopensuseOS Version12
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014450: CMAKE_INSTALL_PREFIX scope
DescriptionThe goal is that to install subdirectory in a custom path (usualy a child of the top directory install path)
the top directory has no sources by itself but is only a container for the subdirectories (the root of a project with other subprojects)

running make install in top directory will not obey the CMAKE_INSTALL_PREFIX that we set in each subdirectory. instead, the default top directory CMAKE_INSTALL_PREFIX value is used
Steps To Reproducecreate one subdirectory and 2 cmake lists:
CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(cmaketest)
ADD_SUBDIRECTORY(1)

1/CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(cmaketest1)
SET(CMAKE_INSTALL_PREFIX /tmp/cmaketest/1)
MESSAGE ("1: CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
INSTALL(FILES 1.h DESTINATION include)
Additional Informationnote the directory "1" must be created and a demo header file in it: "1.h"
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033959)
Brad King (manager)
2013-10-01 11:21

CMake's install rules work with exactly one prefix which can be set at install time by the user or CPack. The prefix set during configuration is just a default. Installation does not support a per-directory prefix. To do that, use something like

 install(FILES 1.h DESTINATION ${LOCAL_PREFIX}include)

where the variable is set above that with code like

 set(LOCAL_PREFIX "1/")

For further help, please ask on the mailing list:

 http://www.cmake.org/mailman/listinfo/cmake [^]
(0035273)
Robert Maynard (manager)
2014-03-05 09:58

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2013-10-01 10:55 georgeg New Issue
2013-10-01 11:21 Brad King Note Added: 0033959
2013-10-01 11:21 Brad King Status new => resolved
2013-10-01 11:21 Brad King Resolution open => won't fix
2014-03-05 09:58 Robert Maynard Note Added: 0035273
2014-03-05 09:58 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team