diff options
-rw-r--r-- | Modules/CPackIFW.cmake | 63 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 25 |
2 files changed, 35 insertions, 53 deletions
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 8463b5d..27546ac 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -25,6 +25,8 @@ # and Mac OS X. # # To use CPack ``IFW`` generator you must also install QtIFW_. +# If you are not using the default path for the installation, please set +# the path to the variable ``QTIFWDIR``. # # Variables # ^^^^^^^^^ @@ -95,7 +97,7 @@ # Additional prepared packages dirs that will be used to resolve # dependent components. # -# Advanced +# Tools # """""""" # # .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE @@ -104,20 +106,12 @@ # # This variable is cached and can be configured user if need. # -# .. variable:: CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND -# -# True if the "binarycreator" command line client was found. -# # .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE # # The path to "repogen" command line client. # # This variable is cached and can be configured user if need. # -# .. variable:: CPACK_IFW_REPOGEN_EXECUTABLE_FOUND -# -# True if the "repogen" command line client was found. -# # Commands # ^^^^^^^^^ # @@ -264,48 +258,41 @@ # Default path +set(_CPACK_IFW_PATHS + "${QTIFWDIR}" + "$ENV{QTIFWDIR}" + "${QTDIR}" + "$ENV{QTIFWDIR}") if(WIN32) - set(_CPACK_IFW_PATHS - "$ENV{HOMEDRIVE}/Qt" - "C:/Qt" - ) + list(APPEND _CPACK_IFW_PATHS + "$ENV{HOMEDRIVE}/Qt" + "C:/Qt") else() - set(_CPACK_IFW_PATHS - "$ENV{HOME}/Qt" - "/opt/Qt" - ) + list(APPEND _CPACK_IFW_PATHS + "$ENV{HOME}/Qt" + "/opt/Qt") endif() set(_CPACK_IFW_SUFFIXES - "QtIFW-1.7.0/bin" - "QtIFW-1.6.0/bin" - "QtIFW-1.5.0/bin" - "QtIFW-1.4.0/bin" - "QtIFW-1.3.0/bin" -) + "bin" + "QtIFW-1.7.0/bin" + "QtIFW-1.6.0/bin" + "QtIFW-1.5.0/bin" + "QtIFW-1.4.0/bin" + "QtIFW-1.3.0/bin") # Look for 'binarycreator' -if(NOT CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND) - find_program(CPACK_IFW_BINARYCREATOR_EXECUTABLE NAMES binarycreator PATHS ${_CPACK_IFW_PATHS} PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES} - DOC "QtIFW binarycreator command line client" - ) -mark_as_advanced(CPACK_IFW_BINARYCREATOR_EXECUTABLE) + DOC "QtIFW binarycreator command line client") -if(EXISTS ${CPACK_IFW_BINARYCREATOR_EXECUTABLE}) - set(CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND 1) -endif() - -endif() # NOT CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND +mark_as_advanced(CPACK_IFW_BINARYCREATOR_EXECUTABLE) # Look for 'repogen' -if(NOT CPACK_IFW_REPOGEN_EXECUTABLE_FOUND) - find_program(CPACK_IFW_REPOGEN_EXECUTABLE NAMES repogen PATHS ${_CPACK_IFW_PATHS} @@ -314,12 +301,6 @@ find_program(CPACK_IFW_REPOGEN_EXECUTABLE ) mark_as_advanced(CPACK_IFW_REPOGEN_EXECUTABLE) -if(EXISTS ${CPACK_IFW_REPOGEN_EXECUTABLE}) - set(CPACK_IFW_REPOGEN_EXECUTABLE_FOUND 1) -endif() - -endif() # NOT CPACK_IFW_REPOGEN_EXECUTABLE_FOUND - # ## Next code is included only once # diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 732938b..dabb3b3 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -223,23 +223,25 @@ int cmCPackIFWGenerator::InitializeInternal() { // Search Qt Installer Framework tools - if(!this->IsOn("CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND") || - !this->IsOn("CPACK_IFW_REPOGEN_EXECUTABLE_FOUND")) + const std::string BinCreatorOpt = "CPACK_IFW_BINARYCREATOR_EXECUTABLE"; + const std::string RepoGenOpt = "CPACK_IFW_REPOGEN_EXECUTABLE"; + + if(!this->IsSet(BinCreatorOpt) || + !this->IsSet(RepoGenOpt)) { this->ReadListFile("CPackIFW.cmake"); } // Look 'binarycreator' executable (needs) - if(this->IsOn("CPACK_IFW_BINARYCREATOR_EXECUTABLE_FOUND")) + const char *BinCreatorStr = this->GetOption(BinCreatorOpt); + if(!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) { - const char *ifwBinCreatorStr = - this->GetOption("CPACK_IFW_BINARYCREATOR_EXECUTABLE"); - BinCreator = ifwBinCreatorStr ? ifwBinCreatorStr : ""; + BinCreator = ""; } else { - BinCreator = ""; + BinCreator = BinCreatorStr; } if (BinCreator.empty()) @@ -253,15 +255,14 @@ int cmCPackIFWGenerator::InitializeInternal() // Look 'repogen' executable (optional) - if(this->IsOn("CPACK_IFW_REPOGEN_EXECUTABLE_FOUND")) + const char *RepoGenStr = this->GetOption(RepoGenOpt); + if(!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) { - const char *ifwRepoGenStr = - this->GetOption("CPACK_IFW_REPOGEN_EXECUTABLE"); - RepoGen = ifwRepoGenStr ? ifwRepoGenStr : ""; + RepoGen = ""; } else { - RepoGen = ""; + RepoGen = RepoGenStr; } // Variables that Change Behavior |