OLD | NEW |
1 #!/usr/bin/env python2.6 | 1 #!/usr/bin/env python2.6 |
2 #-*- mode: python -*- | 2 #-*- mode: python -*- |
3 ##-***************************************************************************** | 3 ##-***************************************************************************** |
4 ## | 4 ## |
5 ## Copyright (c) 2009-2010, Industrial Light & Magic, | 5 ## Copyright (c) 2009-2010, Industrial Light & Magic, |
6 ## a division of Lucasfilm Entertainment Company Ltd. | 6 ## a division of Lucasfilm Entertainment Company Ltd. |
7 ## | 7 ## |
8 ## All rights reserved. | 8 ## All rights reserved. |
9 ## | 9 ## |
10 ## Redistribution and use in source and binary forms, with or without | 10 ## Redistribution and use in source and binary forms, with or without |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 libpath = Path( cmake_args[2] ) | 210 libpath = Path( cmake_args[2] ) |
211 | 211 |
212 libdir, lib = Path( cmake_args[2] ).split() | 212 libdir, lib = Path( cmake_args[2] ).split() |
213 | 213 |
214 try: | 214 try: |
215 cmake_extra_args += ' -D BOOST_INCLUDEDIR:PATH="%s"' % cmake_args[1] | 215 cmake_extra_args += ' -D BOOST_INCLUDEDIR:PATH="%s"' % cmake_args[1] |
216 | 216 |
217 cmake_extra_args += " -D BOOST_LIBRARYDIR:PATH=%s" % libdir | 217 cmake_extra_args += " -D BOOST_LIBRARYDIR:PATH=%s" % libdir |
218 | 218 |
219 cmake_extra_args += " -D Boost_PROGRAM_OPTIONS_LIBRARY:FILEPATH=%s" % li
bpath | 219 cmake_extra_args += " -D Boost_THREAD_LIBRARY:FILEPATH=%s" % libpath |
220 | 220 |
221 cmake_extra_args += ' -G "%s"' % cmake_args[3] | 221 cmake_extra_args += ' -G "%s"' % cmake_args[3] |
222 except IndexError: | 222 except IndexError: |
223 pass | 223 pass |
224 | 224 |
225 cmake_cmd='cmake --debug-trycompile -U BOOTSTRAP_* -D BOOTSTRAP_MODE:INTERNA
L=TRUE -D BOOTSTRAP_BOOST:INTERNAL=TRUE -UBoost_* -UBOOST_* -UALEMBIC_BOOST_FOUN
D %s %s' %\ | 225 cmake_cmd='cmake --debug-trycompile -U BOOTSTRAP_* -D BOOTSTRAP_MODE:INTERNA
L=TRUE -D BOOTSTRAP_BOOST:INTERNAL=TRUE -UBoost_* -UBOOST_* -UALEMBIC_BOOST_FOUN
D %s %s' %\ |
226 (cmake_extra_args, srcdir ) | 226 (cmake_extra_args, srcdir ) |
227 | 227 |
228 print "Executing CMake Boost configure command:\n%s" % cmake_cmd | 228 print "Executing CMake Boost configure command:\n%s" % cmake_cmd |
229 | 229 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 cmakedefault = Path( cmakedefault ) | 413 cmakedefault = Path( cmakedefault ) |
414 cmakedefault = check_include_from_cmake( mf, | 414 cmakedefault = check_include_from_cmake( mf, |
415 cmakedefault.join( "boost" ) ) | 415 cmakedefault.join( "boost" ) ) |
416 | 416 |
417 default = None | 417 default = None |
418 if len( defaults ) > 0 or cmakedefault: | 418 if len( defaults ) > 0 or cmakedefault: |
419 default = choose_defaults( defaults, cmakedefault ) | 419 default = choose_defaults( defaults, cmakedefault ) |
420 | 420 |
421 boost_include_dir = find_path( mf, default ) | 421 boost_include_dir = find_path( mf, default ) |
422 try: | 422 try: |
423 bid = boost_include_dir[:boost_include_dir.index( "boost" )] | 423 bid = boost_include_dir[:boost_include_dir.rindex( "boost" )] |
424 except ValueError: | 424 except ValueError: |
425 bid = boost_include_dir.dirname() | 425 bid = boost_include_dir.dirname() |
426 print | 426 print |
427 print "WARNING!" | 427 print "WARNING!" |
428 print "'%s' is not under a 'boost' directory;" % boost_include_dir | 428 print "'%s' is not under a 'boost' directory;" % boost_include_dir |
429 print "this may not be good." | 429 print "this may not be good." |
430 | 430 |
431 print | 431 print |
432 print "Using Boost include directory: %s" % bid | 432 print "Using Boost include directory: %s" % bid |
433 return bid | 433 return bid |
434 | 434 |
435 ##-***************************************************************************** | 435 ##-***************************************************************************** |
436 def find_boost_program_options_lib( cmakecache = None ): | 436 def find_boost_thread_lib( cmakecache = None ): |
437 print "Please enter the full path to the multithreaded,", | 437 print "Please enter the full path to the multithreaded,", |
438 print "versioned Boost program_options static library" | 438 print "versioned Boost thread static library" |
439 if os.name == "posix": | 439 if os.name == "posix": |
440 print '(eg, "/usr/local/lib/libboost_program_options-gcc41-mt-1_42.a")' | 440 print '(eg, "/usr/local/lib/libboost_thread-gcc41-mt-1_42.a")' |
441 elif os.name == "mac": | 441 elif os.name == "mac": |
442 print '(eg, "/usr/local/lib/libboost_program_options-gcc41-mt-1_42.a")' | 442 print '(eg, "/usr/local/lib/libboost_thread-gcc41-mt-1_42.a")' |
443 elif os.name == "nt": | 443 elif os.name == "nt": |
444 print '(eg, "C:\Program Files\\Boost\\boost_1_42\\lib\\libboost_program_
options-vc80-mt-s-1_42.lib")' | 444 print '(eg, "C:\Program Files\\Boost\\boost_1_42\\lib\\libboost_thread-v
c80-mt-s-1_42.lib")' |
445 else: | 445 else: |
446 # unknown OS - good luck! | 446 # unknown OS - good luck! |
447 print '(eg, "/usr/local/lib/libboost_program_options-gcc41-mt-1_42.a")' | 447 print '(eg, "/usr/local/lib/libboost_thread-gcc41-mt-1_42.a")' |
448 print | 448 print |
449 | 449 |
450 mf = "libboost_program_options" | 450 mf = "libboost_thread" |
451 cmakevar = "Boost_PROGRAM_OPTIONS_LIBRARY" | 451 cmakevar = "Boost_THREAD_LIBRARY" |
452 | 452 |
453 cmakedefault, defaults = get_defaults( mf, cmakevar, cmakecache ) | 453 cmakedefault, defaults = get_defaults( mf, cmakevar, cmakecache ) |
454 | 454 |
455 default = None | 455 default = None |
456 if len( defaults ) > 0 or cmakedefault: | 456 if len( defaults ) > 0 or cmakedefault: |
457 default = choose_defaults( defaults, cmakedefault ) | 457 default = choose_defaults( defaults, cmakedefault ) |
458 | 458 |
459 boost_lib = find_path( mf, default ) | 459 boost_lib = find_path( mf, default ) |
460 libdir, lib = boost_lib.split() | 460 libdir, lib = boost_lib.split() |
461 print "Using Boost libraries from %s" % libdir | 461 print "Using Boost libraries from %s" % libdir |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 return root | 703 return root |
704 | 704 |
705 ##-***************************************************************************** | 705 ##-***************************************************************************** |
706 def configure_boost( options, srcdir, cmakecache ): | 706 def configure_boost( options, srcdir, cmakecache ): |
707 print ''' | 707 print ''' |
708 Alembic requires Boost 1.42 or greater to compile. You must have compiled | 708 Alembic requires Boost 1.42 or greater to compile. You must have compiled |
709 Boost with STATIC, VERSIONED, and MULTITHREADED options turned on. | 709 Boost with STATIC, VERSIONED, and MULTITHREADED options turned on. |
710 ''' | 710 ''' |
711 | 711 |
712 boost_include_dir = "" | 712 boost_include_dir = "" |
713 boost_program_options_library = "" | 713 boost_thread_library = "" |
714 | 714 |
715 cmake_args = [] | 715 cmake_args = [] |
716 cmake_args.append( srcdir ) | 716 cmake_args.append( srcdir ) |
717 | 717 |
718 | 718 |
719 if options.boost_include_dir: | 719 if options.boost_include_dir: |
720 boost_include_dir = options.boost_include_dir | 720 boost_include_dir = options.boost_include_dir |
721 else: | 721 else: |
722 boost_include_dir = str( find_boost_include( cmakecache ) ) | 722 boost_include_dir = str( find_boost_include( cmakecache ) ) |
723 | 723 |
724 if options.boost_program_options_library: | 724 if options.boost_thread_library: |
725 boost_program_options_library = options.boost_program_options_library | 725 boost_thread_library = options.boost_thread_library |
726 else: | 726 else: |
727 boost_program_options_library = str( find_boost_program_options_lib( cma
kecache ) ) | 727 boost_thread_library = str( find_boost_thread_lib( cmakecache ) ) |
728 | 728 |
729 cmake_args.append( boost_include_dir ) | 729 cmake_args.append( boost_include_dir ) |
730 cmake_args.append( boost_program_options_library ) | 730 cmake_args.append( boost_thread_library ) |
731 | 731 |
732 if options.generator: | 732 if options.generator: |
733 print "Makesystem generator %s: " % (options.generator) | 733 print "Makesystem generator %s: " % (options.generator) |
734 cmake_args.append(options.generator) | 734 cmake_args.append(options.generator) |
735 | 735 |
736 boost_status, errors = configureCMakeBoost( cmake_args ) | 736 boost_status, errors = configureCMakeBoost( cmake_args ) |
737 | 737 |
738 if boost_status != 0: | 738 if boost_status != 0: |
739 print "Could not successfully build a Boost test executable!" | 739 print "Could not successfully build a Boost test executable!" |
740 ask_to_exit( errors ) | 740 ask_to_exit( errors ) |
741 | 741 |
742 return boost_status, boost_include_dir, boost_program_options_library | 742 return boost_status, boost_include_dir, boost_thread_library |
743 | 743 |
744 ##-***************************************************************************** | 744 ##-***************************************************************************** |
745 def configure_zlib( options, srcdir, cmakecache ): | 745 def configure_zlib( options, srcdir, cmakecache ): |
746 | 746 |
747 if options.zlib_include_dir: | 747 if options.zlib_include_dir: |
748 zlib_include_dir = options.zlib_include_dir | 748 zlib_include_dir = options.zlib_include_dir |
749 else: | 749 else: |
750 zlib_include_dir = str( find_zlib_include( cmakecache ) ) | 750 zlib_include_dir = str( find_zlib_include( cmakecache ) ) |
751 | 751 |
752 if options.zlib_library: | 752 if options.zlib_library: |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 opts.ilmbase_include_dir | 912 opts.ilmbase_include_dir |
913 | 913 |
914 if opts.ilmbase_imath_library: | 914 if opts.ilmbase_imath_library: |
915 cmake_extra_args += ' -D ALEMBIC_ILMBASE_IMATH_LIB:FILEPATH=%s' % \ | 915 cmake_extra_args += ' -D ALEMBIC_ILMBASE_IMATH_LIB:FILEPATH=%s' % \ |
916 opts.ilmbase_imath_library | 916 opts.ilmbase_imath_library |
917 | 917 |
918 if opts.boost_include_dir: | 918 if opts.boost_include_dir: |
919 cmake_extra_args += ' -D BOOST_INCLUDEDIR:PATH="%s"' % \ | 919 cmake_extra_args += ' -D BOOST_INCLUDEDIR:PATH="%s"' % \ |
920 opts.boost_include_dir | 920 opts.boost_include_dir |
921 | 921 |
922 if opts.boost_program_options_library: | 922 if opts.boost_thread_library: |
923 cmake_extra_args += ' -D Boost_PROGRAM_OPTIONS_LIBRARY:FILEPATH=%s'
% \ | 923 cmake_extra_args += ' -D Boost_THREAD_LIBRARY:FILEPATH=%s' % \ |
924 opts.boost_program_options_library | 924 opts.boost_thread_library |
925 | 925 |
926 if opts.zlib_include_dir: | 926 if opts.zlib_include_dir: |
927 cmake_extra_args += ' -D ZLIB_INCLUDE_DIR:PATH="%s"' % \ | 927 cmake_extra_args += ' -D ZLIB_INCLUDE_DIR:PATH="%s"' % \ |
928 opts.zlib_include_dir | 928 opts.zlib_include_dir |
929 | 929 |
930 if opts.zlib_library: | 930 if opts.zlib_library: |
931 cmake_extra_args += ' -D ZLIB_LIBRARY:FILEPATH=%s' % opts.zlib_libra
ry | 931 cmake_extra_args += ' -D ZLIB_LIBRARY:FILEPATH=%s' % opts.zlib_libra
ry |
932 | 932 |
933 if opts.cflags: | 933 if opts.cflags: |
934 cmake_extra_args += ' -D CMAKE_C_FLAGS:STRING="%s"' % opts.cflags | 934 cmake_extra_args += ' -D CMAKE_C_FLAGS:STRING="%s"' % opts.cflags |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 configOptions.add_option( "--ilmbase_imath_library", | 984 configOptions.add_option( "--ilmbase_imath_library", |
985 dest="ilmbase_imath_library", | 985 dest="ilmbase_imath_library", |
986 type="string", default=None, | 986 type="string", default=None, |
987 help="ilmbase_library_dir location", | 987 help="ilmbase_library_dir location", |
988 metavar="ILMBASE_LIBRARY_DIR" ) | 988 metavar="ILMBASE_LIBRARY_DIR" ) |
989 | 989 |
990 configOptions.add_option( "--boost_include_dir", dest="boost_include_dir", | 990 configOptions.add_option( "--boost_include_dir", dest="boost_include_dir", |
991 type="string", default=None, | 991 type="string", default=None, |
992 help="boost_include_dir location", | 992 help="boost_include_dir location", |
993 metavar="Boost_INCLUDE_DIR" ) | 993 metavar="Boost_INCLUDE_DIR" ) |
994 configOptions.add_option( "--boost_program_options_library", | 994 configOptions.add_option( "--boost_thread_library", |
995 dest="boost_program_options_library", | 995 dest="boost_thread_library", |
996 type="string", default=None, | 996 type="string", default=None, |
997 help="boost_program_options library location", | 997 help="libboost_thread library filepath", |
998 metavar="Boost_PROGRAM_OPTIONS_LIBRARY" ) | 998 metavar="Boost_THREAD_LIBRARY" ) |
999 | 999 |
1000 configOptions.add_option( "--zlib_include_dir", dest="zlib_include_dir", | 1000 configOptions.add_option( "--zlib_include_dir", dest="zlib_include_dir", |
1001 type="string", default=None, | 1001 type="string", default=None, |
1002 help="zlib_include_dir location", | 1002 help="zlib_include_dir location", |
1003 metavar="ZLIB_INCLUDE_DIR" ) | 1003 metavar="ZLIB_INCLUDE_DIR" ) |
1004 configOptions.add_option( "--zlib_library", dest="zlib_library", | 1004 configOptions.add_option( "--zlib_library", dest="zlib_library", |
1005 type="string", default=None, | 1005 type="string", default=None, |
1006 help="zlib library", | 1006 help="zlib library", |
1007 metavar="ZLIB_LIBRARY" ) | 1007 metavar="ZLIB_LIBRARY" ) |
1008 | 1008 |
1009 configOptions.add_option( "--use-contrib", dest="use_contrib", | 1009 configOptions.add_option( "--use-contrib", dest="use_contrib", |
1010 action="store_true", default=False, | 1010 action="store_true", default=False, |
1011 help="Use contrib directory for third-party depend
encies" ) | 1011 help="Use contrib directory for third-party depend
encies" ) |
1012 | 1012 |
1013 # Set the build system that is generated | 1013 # Set the build system that is generated |
1014 configOptions.add_option( "--generator", dest="generator", type="string", | 1014 configOptions.add_option( "--generator", dest="generator", type="string", |
1015 default="Unix Makefiles", help="Default generator"
, | 1015 default="Unix Makefiles", help="Default generator"
, |
1016 metavar="GENERATOR" ) | 1016 metavar="GENERATOR" ) |
1017 | 1017 |
1018 # Options that affect the build | 1018 # Options that affect the build |
1019 configOptions.add_option( "--quiet", dest="quiet", action="store_true", | 1019 configOptions.add_option( "--quiet", dest="quiet", action="store_true", |
1020 default=False, help="Generate quiet Makefiles" ) | 1020 default=False, help="Generate quiet Makefiles" ) |
1021 | 1021 |
1022 configOptions.add_option( "--debug", dest="debug", | 1022 configOptions.add_option( "--debug", dest="debug", |
1023 action="store_true", default=False, | 1023 action="store_true", default=False, |
1024 help="Generate debug Makefiles" ) | 1024 help="Generate debug Makefiles" ) |
1025 | 1025 |
1026 configOptions.add_option( "--shared", dest="sharedLibs", | 1026 configOptions.add_option( "--shared", dest="sharedLibs", |
1027 action="store_true", default=False, | 1027 action="store_true", default=False, |
1028 help="Build shared libraries" )
| 1028 help="Build shared libraries" ) |
1029 | 1029 |
1030 configOptions.add_option( "--cflags", dest="cflags", type="string", | 1030 configOptions.add_option( "--cflags", dest="cflags", type="string", |
1031 default=None, help="CFLAGS to pass to the compiler
", | 1031 default=None, help="CFLAGS to pass to the compiler
", |
1032 metavar="CFLAGS" ) | 1032 metavar="CFLAGS" ) |
1033 | 1033 |
1034 configOptions.add_option( "--cxxflags", dest="cxxflags", type="string", | 1034 configOptions.add_option( "--cxxflags", dest="cxxflags", type="string", |
1035 default=None, help="CXXFLAGS to pass to the compil
er", | 1035 default=None, help="CXXFLAGS to pass to the compil
er", |
1036 metavar="CXXFLAGS" ) | 1036 metavar="CXXFLAGS" ) |
1037 | 1037 |
1038 configOptions.add_option( "--disable-prman", dest="disable_prman", | 1038 configOptions.add_option( "--disable-prman", dest="disable_prman", |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 # args passed from command line | 1087 # args passed from command line |
1088 runCMake( options, alembic_src_dir, ranBootstrap ) | 1088 runCMake( options, alembic_src_dir, ranBootstrap ) |
1089 | 1089 |
1090 return 0 | 1090 return 0 |
1091 | 1091 |
1092 ##-***************************************************************************** | 1092 ##-***************************************************************************** |
1093 if __name__ == "__main__": | 1093 if __name__ == "__main__": |
1094 sys.exit( main() ) | 1094 sys.exit( main() ) |
1095 | 1095 |
1096 | 1096 |
OLD | NEW |