Skip to content

Commit

Permalink
Fixed Building grass with Ubuntu System Libraries and cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh1998 committed Jul 17, 2024
1 parent e446882 commit 8291252
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 88 deletions.
11 changes: 7 additions & 4 deletions display/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if(WITH_DOCS)
DESTINATION ${GRASS_INSTALL_DOCDIR})
endif()
build_program_in_subdir(d.grid DEPENDS grass_gis grass_symb grass_gproj
grass_display LIBM)
grass_display GDAL LIBM)
build_program_in_subdir(d.his DEPENDS grass_gis grass_display grass_raster)
build_program_in_subdir(d.histogram DEPENDS grass_gis grass_display
grass_raster LIBM)
Expand All @@ -103,7 +103,7 @@ if(WITH_DOCS)
install(DIRECTORY ${OUTDIR}/${GRASS_INSTALL_DOCDIR}/northarrows
DESTINATION ${GRASS_INSTALL_DOCDIR})
endif()
build_program_in_subdir(d.path DEPENDS grass_gis grass_display grass_vector)
build_program_in_subdir(d.path DEPENDS grass_gis grass_display grass_vector GDAL)
build_program_in_subdir(d.profile DEPENDS grass_gis grass_display grass_raster LIBM)
build_program_in_subdir(d.rast DEPENDS grass_gis grass_display grass_raster)
build_program_in_subdir(d.rast.arrow DEPENDS grass_gis grass_raster
Expand All @@ -125,6 +125,7 @@ build_program_in_subdir(
grass_raster
grass_symb
grass_vector
GDAL
LIBM)
build_program_in_subdir(
d.vect.chart
Expand All @@ -136,6 +137,7 @@ build_program_in_subdir(
grass_gis
grass_symb
grass_vector
GDAL
LIBM)
build_program_in_subdir(
d.vect.thematic
Expand All @@ -147,5 +149,6 @@ build_program_in_subdir(
grass_display
grass_gis
grass_symb
grass_vector)
build_program_in_subdir(d.where DEPENDS grass_gis grass_display grass_gproj)
grass_vector
GDAL)
build_program_in_subdir(d.where DEPENDS grass_gis grass_display grass_gproj GDAL)
4 changes: 3 additions & 1 deletion general/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ build_program_in_subdir(
grass_raster3d
grass_gmath
PROJ
GDAL
LIBM)

build_program_in_subdir(g.rename DEPENDS grass_gis grass_manage grass_raster)
Expand Down Expand Up @@ -72,7 +73,8 @@ build_program_in_subdir(
grass_manage
grass_raster
grass_raster3d
grass_vector)
grass_vector
GDAL)
add_dependencies(g.list cell vector)

build_program_in_subdir(g.remove DEPENDS grass_gis grass_manage grass_raster)
Expand Down
1 change: 1 addition & 0 deletions general/manage/lister/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build_program(
grass_dbmibase
grass_gis
grass_raster
GDAL
RUNTIME_OUTPUT_DIR
"${GRASS_INSTALL_ETCDIR}/lister"
NO_DOCS)
11 changes: 7 additions & 4 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ add_subdirectory(fonts)

add_subdirectory(vector)

build_library_in_subdir(imagery DEPENDS grass_gis grass_vector grass_raster)
build_library_in_subdir(imagery DEPENDS grass_gis grass_vector grass_raster GDAL)

build_library_in_subdir(cluster DEPENDS grass_imagery grass_gis grass_raster)

Expand All @@ -168,6 +168,7 @@ build_library_in_subdir(
grass_dbmidriver
grass_gmath
grass_segment
GDAL
HEADERS
"lidar.h")

Expand All @@ -181,7 +182,8 @@ build_program_in_subdir(
DEPENDS
grass_gis
grass_raster3d
grass_raster)
grass_raster
GDAL)

build_library_in_subdir(
gpde
Expand Down Expand Up @@ -217,7 +219,7 @@ build_library_in_subdir(stats DEPENDS grass_gis grass_raster)

build_library_in_subdir(arraystats DEPENDS grass_gis)

if(WITH_OPENGL)
if(WITH_OPENGL AND OPENGL_GLU_FOUND AND OpenGL_GLX_FOUND)
build_library_in_subdir(
ogsf
DEPENDS
Expand All @@ -229,6 +231,7 @@ if(WITH_OPENGL)
grass_raster
grass_raster3d
grass_vector
GDAL
OPENGL
TIFF)

Expand All @@ -250,7 +253,7 @@ add_subdirectory(temporal)
build_library_in_subdir(iostream SRC_REGEX "*.cpp" DEPENDS grass_gis)

build_library_in_subdir(manage DEPENDS grass_gis grass_raster grass_vector
grass_raster3d)
grass_raster3d GDAL)
file(COPY manage/element_list DESTINATION ${OUTDIR}/${GRASS_INSTALL_ETCDIR})
install(FILES ${OUTDIR}/${GRASS_INSTALL_ETCDIR}/element_list
DESTINATION ${GRASS_INSTALL_ETCDIR})
Expand Down
1 change: 1 addition & 0 deletions lib/rst/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ build_library_in_subdir(
grass_vector
grass_qtree
grass_interpdata
GDAL
LIBM
OPTIONAL_DEPENDS
OPENMP
Expand Down
6 changes: 4 additions & 2 deletions lib/vector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ build_library_in_subdir(
grass_vector
grass_dbmibase
grass_dbmiclient
grass_dbmidriver)
grass_dbmidriver
GDAL)

build_library_in_subdir(
neta
Expand All @@ -54,7 +55,8 @@ build_library_in_subdir(
grass_dbmidriver
grass_gis
grass_dgl
grass_vector)
grass_vector
GDAL)

if(WITH_DOCS)
generate_html(TARGET grass_vector NAME vectorascii)
Expand Down
4 changes: 2 additions & 2 deletions misc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build_program_in_subdir(m.measure DEPENDS grass_gis)
build_program_in_subdir(m.transform DEPENDS grass_gis grass_imagery
grass_raster grass_vector LIBM)

if(WITH_OPENGL)
if(TARGET grass_ogsf)
build_program_in_subdir(
m.nviz.image
DEPENDS
Expand All @@ -19,4 +19,4 @@ if(WITH_OPENGL)

build_program_in_subdir(m.nviz.script DEPENDS grass_display grass_raster
grass_gis LIBM)
endif(WITH_OPENGL)
endif(TARGET grass_ogsf)
1 change: 1 addition & 0 deletions ps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build_program_in_subdir(
grass_dbmiclient
grass_dbmidriver
grass_symb
GDAL
LIBM)

add_custom_command(
Expand Down
2 changes: 1 addition & 1 deletion python/libgrass_interface_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(MODULES
rowio
temporal)

if(WITH_OPENGL)
if(TARGET grass_ogsf)
list(APPEND MODULES ogsf nviz)
endif()

Expand Down
37 changes: 25 additions & 12 deletions raster/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ build_program_in_subdir(
grass_vector
grass_bitmap
grass_dig2
GDAL
LIBM)

build_program_in_subdir(r.category DEPENDS grass_gis grass_raster)
Expand Down Expand Up @@ -188,10 +189,11 @@ build_program_in_subdir(
grass_dbmibase
grass_dbmiclient
grass_dbmidriver
GDAL
LIBM)

build_program_in_subdir(r.cost DEPENDS grass_gis grass_raster grass_segment
grass_vector LIBM)
grass_vector GDAL LIBM)

build_program_in_subdir(r.covar DEPENDS grass_gis grass_raster LIBM)

Expand Down Expand Up @@ -226,6 +228,7 @@ build_program_in_subdir(
grass_segment
grass_vector
grass_bitmap
GDAL
LIBM)

build_program_in_subdir(r.geomorphon DEPENDS grass_gis grass_raster grass_gmath LIBM)
Expand All @@ -238,7 +241,7 @@ build_program_in_subdir(r.gwflow DEPENDS grass_gis grass_raster grass_gpde
build_program_in_subdir(r.his DEPENDS grass_gis grass_raster grass_gproj)

build_program_in_subdir(r.horizon DEPENDS grass_gis grass_raster grass_gproj
grass_parson LIBM)
grass_parson GDAL LIBM)

build_program_in_subdir(r.in.ascii DEPENDS grass_gis grass_raster)

Expand Down Expand Up @@ -270,6 +273,7 @@ build_program_in_subdir(
grass_gmath
grass_segment
grass_gproj
GDAL
LIBM
PRIMARY_DEPENDS
PDAL)
Expand All @@ -288,7 +292,7 @@ build_program_in_subdir(r.info TEST_SOURCES "test_r_info.py" DEPENDS grass_gis L

build_program_in_subdir(r.kappa DEPENDS grass_gis grass_raster LIBM)

build_program_in_subdir(r.latlong DEPENDS grass_gis grass_raster grass_gproj)
build_program_in_subdir(r.latlong DEPENDS grass_gis grass_raster grass_gproj GDAL)

build_program_in_subdir(r.lake DEPENDS grass_gis grass_raster)

Expand Down Expand Up @@ -374,7 +378,7 @@ build_program_in_subdir(
build_program_in_subdir(r.patch DEPENDS grass_gis grass_raster OPTIONAL_DEPENDS
OPENMP)

build_program_in_subdir(r.path DEPENDS grass_gis grass_raster grass_vector)
build_program_in_subdir(r.path DEPENDS grass_gis grass_raster grass_vector GDAL)

build_program_in_subdir(r.profile DEPENDS grass_gis grass_raster grass_parson LIBM)

Expand All @@ -384,6 +388,7 @@ build_program_in_subdir(
grass_gis
grass_raster
grass_gproj
GDAL
LIBM
OPTIONAL_DEPENDS
OPENMP)
Expand All @@ -401,6 +406,7 @@ build_program_in_subdir(
grass_dbmibase
grass_dbmiclient
grass_dbmidriver
GDAL
LIBM)

build_program_in_subdir(r.random.cells DEPENDS grass_gis grass_raster LIBM)
Expand All @@ -411,7 +417,7 @@ build_program_in_subdir(r.reclass DEPENDS grass_gis grass_raster grass_manage)

build_program_in_subdir(r.recode DEPENDS grass_gis grass_raster)

build_program_in_subdir(r.region DEPENDS grass_gis grass_raster grass_vector)
build_program_in_subdir(r.region DEPENDS grass_gis grass_raster grass_vector GDAL)

build_program_in_subdir(r.regression.line DEPENDS grass_gis grass_raster LIBM)

Expand All @@ -428,6 +434,7 @@ build_program_in_subdir(
grass_vector
grass_segment
grass_lidar
GDAL
LIBM)

build_program_in_subdir(r.resamp.filter DEPENDS grass_gis grass_raster LIBM
Expand All @@ -444,7 +451,9 @@ build_program_in_subdir(
grass_gmath
grass_interpfl
grass_interpdata
grass_qtree)
grass_qtree
GDAL)


build_program_in_subdir(r.resamp.stats DEPENDS grass_gis grass_raster
grass_stats LIBM)
Expand Down Expand Up @@ -511,6 +520,7 @@ build_program_in_subdir(
grass_dbmibase
grass_dbmiclient
grass_dbmidriver
GDAL
LIBM)

build_program_in_subdir(
Expand All @@ -520,13 +530,14 @@ build_program_in_subdir(
grass_gmath
grass_raster
grass_gproj
GDAL
LIBM
OPTIONAL_DEPENDS
OPENMP)

build_program_in_subdir(r.sunhours DEPENDS grass_gis grass_raster grass_gproj LIBM)
build_program_in_subdir(r.sunhours DEPENDS grass_gis grass_raster grass_gproj GDAL LIBM)

build_program_in_subdir(r.sunmask DEPENDS grass_gis grass_raster grass_gproj LIBM)
build_program_in_subdir(r.sunmask DEPENDS grass_gis grass_raster grass_gproj GDAL LIBM)

build_program_in_subdir(r.support DEPENDS grass_gis grass_raster)

Expand Down Expand Up @@ -574,7 +585,8 @@ build_program_in_subdir(
grass_vector
grass_dbmibase
grass_dbmiclient
grass_dbmidriver)
grass_dbmidriver
GDAL)

build_program_in_subdir(r.topidx DEPENDS grass_gis grass_raster LIBM)

Expand All @@ -596,15 +608,16 @@ build_program_in_subdir(
grass_vector
grass_dbmibase
grass_dbmiclient
grass_dbmidriver)
grass_dbmidriver
GDAL)

build_program_in_subdir(r.walk DEPENDS grass_gis grass_raster grass_segment
grass_vector LIBM)
grass_vector GDAL LIBM)

build_program_in_subdir(r.water.outlet DEPENDS grass_gis grass_raster)

build_program_in_subdir(r.what DEPENDS grass_gis grass_raster grass_vector
grass_parson)
grass_parson GDAL)

build_program_in_subdir(r.what.color DEPENDS grass_gis grass_raster)

Expand Down
3 changes: 3 additions & 0 deletions raster/r.sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build_library_in_subdir(
grass_raster
grass_vector
grass_gmath
GDAL
LIBM
OPTIONAL_DEPENDS
OPENMP
Expand All @@ -21,6 +22,7 @@ build_program_in_subdir(
grass_gis
grass_gmath
grass_sim
GDAL
OPTIONAL_DEPENDS
OPENMP
INCLUDES
Expand All @@ -32,6 +34,7 @@ build_program_in_subdir(
grass_gis
grass_gmath
grass_sim
GDAL
OPTIONAL_DEPENDS
OPENMP
INCLUDES
Expand Down
2 changes: 2 additions & 0 deletions raster3d/r3.flow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build_program(
grass_raster
grass_raster3d
grass_vector
GDAL
LIBM)

set(test_r3flow_SRCS test_main.c flowline.c integrate.c interpolate.c
Expand All @@ -31,4 +32,5 @@ build_program(
grass_dbmiclient
grass_dbmidriver
grass_vector
GDAL
LIBM)
Loading

0 comments on commit 8291252

Please sign in to comment.