From 86cf242cbcda5fcacafeb7f005907daf1ad11bac Mon Sep 17 00:00:00 2001 From: Camille GOUTTEBROZE Date: Thu, 4 Dec 2014 15:16:08 +0100 Subject: [PATCH] Check options for default profile generator --- src/AppQuickStart/app-quickstart.py | 12 +++++++++++- src/AppQuickStart/app-template/CMakeLists.txt | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/AppQuickStart/app-quickstart.py b/src/AppQuickStart/app-quickstart.py index 2a0cabbc1..04409a99e 100755 --- a/src/AppQuickStart/app-quickstart.py +++ b/src/AppQuickStart/app-quickstart.py @@ -241,10 +241,20 @@ def profileGenerateSources( options, args ) : # ----------------------------------------------------------------------------- if __name__ == '__main__': - + #Get options and args (options, args) = profileQuickStartParser().parse_args() + #Check name of the application if not options.name : raise RuntimeError( "A name must be given to the application. Please use option --name." ) + #Check that no modules has the name of the application + if options.name in options.modules.split( ',' ) : + raise RuntimeError( "An application cannnot be named like one of its modules.\nWhat about naming your application %sIS (%s In Salome) ?" %( options.name,options.name ) ) + + #Check if the prefix is a directory + if not os.path.isdir( options.prefix ) : + raise RuntimeError( "%s is not a directory." % options.prefix ) + + #Generate sources of the profile profileGenerateSources( options, args ) diff --git a/src/AppQuickStart/app-template/CMakeLists.txt b/src/AppQuickStart/app-template/CMakeLists.txt index 95e895ac9..589425ed5 100644 --- a/src/AppQuickStart/app-template/CMakeLists.txt +++ b/src/AppQuickStart/app-template/CMakeLists.txt @@ -100,7 +100,7 @@ ADD_SUBDIRECTORY( src ) ADD_SUBDIRECTORY( resources ) ADD_SUBDIRECTORY( doc ) -# Additional files +# Additional files # ================ SET(_salome_context_API_SCRIPTS ${KERNEL_ROOT_DIR}/bin/salome/salomeContext.py -- 2.39.2