| 6 | |
| 7 | |
| 8 | def get_program_parameters(): |
| 9 | import argparse |
| 10 | description = 'Generate a find_package(VTK COMPONENTS ...) that lists all modules referenced by a set of files.' |
| 11 | epilogue = ''' |
| 12 | This uses the VTK source folder to determine the modules and headers. |
| 13 | Then the user files/folders are looked at to find the headers being used. |
| 14 | Finally a find_package() is output with the modules you need for |
| 15 | inclusion in your CMakeLists.txt file. |
| 16 | |
| 17 | Note: |
| 18 | 1) If include file(s) are not found when building your application. |
| 19 | You may need to search the VTK source to find where the file is. |
| 20 | Then look at contents of vtk.module in that folder and add the |
| 21 | module name to the find_package statement. |
| 22 | 2) If linking fails, it usually means that the needed module has not been |
| 23 | built, so you may need to add it to your VTK build and rebuild VTK. |
| 24 | 3) More modules than strictly necessary may be included. |
| 25 | ''' |
| 26 | parser = argparse.ArgumentParser(description=description, epilog=epilogue, |
| 27 | formatter_class=argparse.RawDescriptionHelpFormatter) |
| 28 | parser.add_argument('vtk_path', help='The path to the VTK source tree.') |
| 29 | parser.add_argument('application', nargs='+', help='Paths to the application files or folders.') |
| 30 | args = parser.parse_args() |
| 31 | return args.vtk_path, args.application |
| 32 | |
| 33 | |
| 34 | def check_paths(vtk_src_dir, application_srcs): |