ENH: install working with symlink qt tool
This commit is contained in:
parent
4a9517a688
commit
ee2a13b11f
@ -38,6 +38,22 @@ cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
|
||||||
|
const char* script,
|
||||||
|
const char* name)
|
||||||
|
{
|
||||||
|
std::string dst = resdir;
|
||||||
|
dst += "/";
|
||||||
|
dst += name;
|
||||||
|
cmSystemTools::CopyFileAlways(script, dst.c_str());
|
||||||
|
cmSystemTools::SetPermissions(dst.c_str(),0777);
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||||
|
"copy script : " << script << "\ninto " << dst.c_str() <<
|
||||||
|
std::endl);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName,
|
int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName,
|
||||||
const char* toplevel,
|
const char* toplevel,
|
||||||
@ -50,15 +66,51 @@ int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName,
|
|||||||
resDir += "/Resources";
|
resDir += "/Resources";
|
||||||
std::string preflightDirName = resDir + "/PreFlight";
|
std::string preflightDirName = resDir + "/PreFlight";
|
||||||
std::string postflightDirName = resDir + "/PostFlight";
|
std::string postflightDirName = resDir + "/PostFlight";
|
||||||
|
const char* preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT");
|
||||||
if ( !cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())
|
const char* postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT");
|
||||||
|| !cmsys::SystemTools::MakeDirectory(postflightDirName.c_str()) )
|
const char* postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT");
|
||||||
|
// if preflight or postflight scripts not there create directories
|
||||||
|
// of the same name, I think this makes it work
|
||||||
|
if(!preflight)
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
if ( !cmsys::SystemTools::MakeDirectory(preflightDirName.c_str()))
|
||||||
"Problem creating installer directories: "
|
{
|
||||||
<< preflightDirName.c_str() << " and "
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
<< postflightDirName.c_str() << std::endl);
|
"Problem creating installer directory: "
|
||||||
return 0;
|
<< preflightDirName.c_str() << std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!postflight)
|
||||||
|
{
|
||||||
|
if ( !cmsys::SystemTools::MakeDirectory(postflightDirName.c_str()))
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"Problem creating installer directory: "
|
||||||
|
<< postflightDirName.c_str() << std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if preflight, postflight, or postupgrade are set
|
||||||
|
// then copy them into the resource directory and make
|
||||||
|
// them executable
|
||||||
|
if(preflight)
|
||||||
|
{
|
||||||
|
this->CopyInstallScript(resDir.c_str(),
|
||||||
|
preflight,
|
||||||
|
"preflight");
|
||||||
|
}
|
||||||
|
if(postflight)
|
||||||
|
{
|
||||||
|
this->CopyInstallScript(resDir.c_str(),
|
||||||
|
postflight,
|
||||||
|
"postflight");
|
||||||
|
}
|
||||||
|
if(postupgrade)
|
||||||
|
{
|
||||||
|
this->CopyInstallScript(resDir.c_str(),
|
||||||
|
postupgrade,
|
||||||
|
"postupgrade");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this->CopyCreateResourceFile("License")
|
if ( !this->CopyCreateResourceFile("License")
|
||||||
|
@ -39,6 +39,9 @@ public:
|
|||||||
virtual ~cmCPackPackageMakerGenerator();
|
virtual ~cmCPackPackageMakerGenerator();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int CopyInstallScript(const char* resdir,
|
||||||
|
const char* script,
|
||||||
|
const char* name);
|
||||||
virtual int InitializeInternal();
|
virtual int InitializeInternal();
|
||||||
int CompressFiles(const char* outFileName, const char* toplevel,
|
int CompressFiles(const char* outFileName, const char* toplevel,
|
||||||
const std::vector<std::string>& files);
|
const std::vector<std::string>& files);
|
||||||
|
@ -13,8 +13,6 @@ ELSE(NOT QT4_FOUND)
|
|||||||
IF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
IF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
||||||
SET(CMAKE_PACKAGE_QTGUI FALSE)
|
SET(CMAKE_PACKAGE_QTGUI FALSE)
|
||||||
ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static")
|
||||||
CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
|
|
||||||
"${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
|
|
||||||
SET(SRCS
|
SET(SRCS
|
||||||
AddCacheEntry.cxx
|
AddCacheEntry.cxx
|
||||||
AddCacheEntry.h
|
AddCacheEntry.h
|
||||||
@ -69,9 +67,19 @@ ELSE(NOT QT4_FOUND)
|
|||||||
${CMAKE_INSTALL_DESTINATION_ARGS})
|
${CMAKE_INSTALL_DESTINATION_ARGS})
|
||||||
ENDIF(CMAKE_PACKAGE_QTGUI)
|
ENDIF(CMAKE_PACKAGE_QTGUI)
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
|
SET(CMAKE_POSTFLIGHT_SCRIPT
|
||||||
|
"${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
|
||||||
|
SET(CMAKE_POSTUPGRADE_SCRIPT
|
||||||
|
"${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
|
||||||
|
configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
|
||||||
|
"${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
|
||||||
|
configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
|
||||||
|
"${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
|
||||||
INSTALL(CODE "set(input_file
|
INSTALL(CODE "set(input_file
|
||||||
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/cmake-gui\")")
|
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/cmake-gui\")")
|
||||||
INSTALL(SCRIPT "${CMake_SOURCE_DIR}/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake")
|
INSTALL(SCRIPT "${CMake_SOURCE_DIR}/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake")
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
|
||||||
|
"${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
|
||||||
ENDIF(NOT QT4_FOUND)
|
ENDIF(NOT QT4_FOUND)
|
||||||
|
|
||||||
|
@ -3,11 +3,15 @@ SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
|
|||||||
|
|
||||||
IF(CMAKE_PACKAGE_QTGUI)
|
IF(CMAKE_PACKAGE_QTGUI)
|
||||||
SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)")
|
SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)")
|
||||||
IF(IS_APPLE)
|
IF(IS_APPLE)
|
||||||
# for apple install we set the install prefix to /Applications and then install
|
# for apple install we set the install prefix to
|
||||||
# cmake into the bundle for cmake-gui
|
# / and then install
|
||||||
SET(CPACK_SET_DESTDIR TRUE)
|
# cmake into the bundle for cmake-gui and must use DESTDIR
|
||||||
ENDIF(IS_APPLE)
|
SET(CPACK_SET_DESTDIR TRUE)
|
||||||
|
# we also want to run post install stuff to setup command line
|
||||||
|
SET(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
|
||||||
|
SET(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
|
||||||
|
ENDIF(IS_APPLE)
|
||||||
ENDIF(CMAKE_PACKAGE_QTGUI)
|
ENDIF(CMAKE_PACKAGE_QTGUI)
|
||||||
|
|
||||||
|
|
||||||
|
4
Source/QtDialog/postflight.sh.in
Executable file
4
Source/QtDialog/postflight.sh.in
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "$2/@CMAKE_INSTALL_SUBDIR@/cmake-gui.app/Contents/MacOS/cmake-gui" >>/tmp/mylog
|
||||||
|
"$2/@CMAKE_INSTALL_SUBDIR@/cmake-gui.app/Contents/MacOS/cmake-gui" --mac-install
|
||||||
|
exit 0
|
2
Source/QtDialog/postupgrade.sh.in
Executable file
2
Source/QtDialog/postupgrade.sh.in
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user