Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
e48dc064
Commit
e48dc064
authored
Mar 15, 2006
by
Andy Cedilnik
Browse files
ENH: Allow multiple install directories
parent
1aecb478
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/CPack/cmCPackGenericGenerator.cxx
View file @
e48dc064
...
...
@@ -229,31 +229,40 @@ int cmCPackGenericGenerator::InstallProject()
}
}
}
const
char
*
binaryDir
=
this
->
GetOption
(
"CPACK_BINARY_DIR"
);
if
(
binaryDir
)
{
std
::
string
installFile
=
binaryDir
;
installFile
+=
"/cmake_install.cmake"
;
cmake
cm
;
cmGlobalGenerator
gg
;
gg
.
SetCMakeInstance
(
&
cm
);
std
::
auto_ptr
<
cmLocalGenerator
>
lg
(
gg
.
CreateLocalGenerator
());
lg
->
SetGlobalGenerator
(
&
gg
);
cmMakefile
*
mf
=
lg
->
GetMakefile
();
if
(
movable
)
{
mf
->
AddDefinition
(
"CMAKE_INSTALL_PREFIX"
,
tempInstallDirectory
);
}
const
char
*
buildConfig
=
this
->
GetOption
(
"CPACK_BUILD_CONFIG"
);
if
(
buildConfig
&&
*
buildConfig
)
const
char
*
binaryDirectories
=
this
->
GetOption
(
"CPACK_BINARY_DIR"
);
if
(
binaryDirectories
)
{
std
::
vector
<
std
::
string
>
binaryDirectoriesVector
;
cmSystemTools
::
ExpandListArgument
(
binaryDirectories
,
binaryDirectoriesVector
);
std
::
vector
<
std
::
string
>::
iterator
it
;
for
(
it
=
binaryDirectoriesVector
.
begin
();
it
!=
binaryDirectoriesVector
.
end
();
++
it
)
{
mf
->
AddDefinition
(
"BUILD_TYPE"
,
buildConfig
);
}
std
::
string
installFile
=
it
->
c_str
();
installFile
+=
"/cmake_install.cmake"
;
cmake
cm
;
cmGlobalGenerator
gg
;
gg
.
SetCMakeInstance
(
&
cm
);
std
::
auto_ptr
<
cmLocalGenerator
>
lg
(
gg
.
CreateLocalGenerator
());
lg
->
SetGlobalGenerator
(
&
gg
);
cmMakefile
*
mf
=
lg
->
GetMakefile
();
if
(
movable
)
{
mf
->
AddDefinition
(
"CMAKE_INSTALL_PREFIX"
,
tempInstallDirectory
);
}
const
char
*
buildConfig
=
this
->
GetOption
(
"CPACK_BUILD_CONFIG"
);
if
(
buildConfig
&&
*
buildConfig
)
{
mf
->
AddDefinition
(
"BUILD_TYPE"
,
buildConfig
);
}
res
=
mf
->
ReadListFile
(
0
,
installFile
.
c_str
());
if
(
cmSystemTools
::
GetErrorOccuredFlag
()
)
{
res
=
0
;
res
=
mf
->
ReadListFile
(
0
,
installFile
.
c_str
());
if
(
cmSystemTools
::
GetErrorOccuredFlag
()
)
{
res
=
0
;
}
}
}
if
(
!
movable
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment