Ubuntu上用premake编译GDAL

时间:2025-03-30 12:27:22
-- A solution contains projects, and defines the available configurations solution ("gdal") configurations {"Debug64","Release64", "Debug32", "Release32"} location "build" includedirs { "/usr/src/linux-headers-3.8.0-30-generic/include/config/pci/", "/usr/include/x86_64-linux-gnu/c++/4.8" } configuration "Debug64" targetdir "output/linux_debug_x64" defines { "DEBUG", "HAVE_SSE_AT_COMPILE_TIME" } flags {"Symbols"} configuration "Debug32" targetdir "output/linux_debug_x32" defines { "DEBUG", "HAVE_SSE_AT_COMPILE_TIME" } buildoptions {"-m32"} linkoptions {"-m32"} flags {"Symbols"} configuration "Release64" targetdir "output/linux_release_x64" defines { "NDEBUG", "HAVE_SSE_AT_COMPILE_TIME" } flags {"OptimizeSize"} configuration "Release32" targetdir "output/linux_release_x32" defines { "NDEBUG", "HAVE_SSE_AT_COMPILE_TIME" } buildoptions {"-m32"} linkoptions {"-m32"} flags {"OptimizeSize"} -- project port defines one build target p = project("port") basedir() location("build/" .. ) kind "SharedLib" language "C++" files { .. "/*.h", .. "/*.cpp" } excludes { .. "/cpl_vsil_stdout.cpp", .. "/cpl_odbc.cpp", .. "/cpl_win32ce_api.cpp", .. "/cpl_vsil_simple.cpp", .. "/cpl_vsil_win32.cpp", .. "/cpl_vsil_gzip.cpp", .. "/cpl_vsil_buffered_reader.cpp", .. "/cpl_minizip_zip", .. "/cpl_minizip_zip.cpp", .. "/cpl_minizip_unzip.cpp", .. "/", .. "/cpl_vsil_tar.cpp", .. "/cpl_quad_tree.cpp", .. "/cpl_vsil_readahead_reader.cp", .. "/cpl_google_oauth2.cpp", .. "/cpl_vsil_curl.cpp", .. "/cpl_vsil_curl_streaming.cpp", .. "/cpl_minizip_ioapi.cpp", .. "/cpl_vsil_abstract_archive.cpp", .. "/cpl_vsil_cache.cpp", .. "/cpl_spawn.cpp" } includedirs { "./port", "./ogr", "./gcore", "./alg", "./ogr/ogrsf_frmts", "./frmts/zlib" } -- project ogr defines one build target p = project("ogr") basedir() location("build/" .. ) -- build .a here because nmake generats kind "StaticLib" language "C++" files { .. "/*.c", .. "/*.cpp" } excludes { .. "/", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/swq_op_registrar.cpp", .. "/ogr_api.cpp", .. "/", .. "/", .. "/ogr_opt.cpp", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/", .. "/swq_op_general.cpp", .. "/", .. "/", .. "/swq_parser.cpp", .. "/", .. "/swq_select.cpp", .. "/swq_expr_node.cpp", .. "/", .. "/", } includedirs { "./port", "./ogr", "./gcore", "./alg", "./ogr/ogrsf_frmts", "./ogrsf_frmts", "./frmts/gtiff/libgeotiff" } -- project ogr defines one build target p = project("gcore") basedir() location("build/" .. ) kind "SharedLib" language "C++" files { .. "/*.h", .. "/*.cpp" } excludes { .. "/", .. "/", .. "/" } includedirs { "./port", "./ogr", "./gcore", "./alg", "./ogr/ogrsf_frmts", "./ogrsf_frmts", "./frmts/gtiff" } -- project frmts defines one build target -- After this last project build is finished, then link all obj and libs to library p = project("frmts") basedir() location("build/" .. ) kind "SharedLib" language "C++" files { .. "/*.cpp", .. "/jpeg/*.cpp", .. "/jpeg/*.c", .. "/nitf/*.cpp", .. "/nitf/*.c", .. "/gtiff/*.cpp", .. "/gtiff/*.c", .. "/gtiff/libtiff/*.c", .. "/gtiff/libgeotiff/*.c", .. "/jpeg/*.cpp", .. "/jpeg/*.c", .. "/dted/*.cpp", .. "/dted/*.c", .. "/zlib/*.cpp", .. "/zlib/*.c" } excludes { .. "/nitf/", .. "/nitf/", .. "/dted/dted_test.c", .. "/dted/", .. "/gtiff/libtiff/tif_print.c", .. "/gtiff/libgeotiff/geo_trans.c", .. "/zlib/" } includedirs { "./port", "./ogr", "./gcore", "./alg", "./ogr/ogrsf_frmts", "./frmts/zlib", "./frmts/jpeg/libjpeg", "./frmts/gtiff/libtiff", "./frmts/vrt", "./frmts/gtiff/libgeotiff", "./frmts/jpeg/jpeg-8c" } defines { "FRMT_nitf", "DFRMT_gtiff", "FRMT_jpeg", "FRMT_dted", "FRMT_zlib" }

相关文章