Skip to content

Commit

Permalink
Tweak bext_enable to see if we can use it with the cad_enable function.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Apr 1, 2024
1 parent cc241b0 commit 40ff1b4
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 252 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,15 @@ macro(bext_enable pname)
set(ENABLE_${upname} ON)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_${upname})

if (NOT ENABLE_${upname})
if (NOT ENABLE_${upname} AND NOT DISABLE_${upname})

find_package(${pname})

if (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})
set(ENABLE_${upname} "ON" CACHE BOOL "Enable ${pname} build")
endif (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})

endif (NOT ENABLE_${upname})
endif (NOT ENABLE_${upname} AND NOT DISABLE_${upname})
set(ENABLE_${upname} "${ENABLE_${upname}}" CACHE BOOL "Enable ${pname} build")
endmacro(bext_enable pname)

Expand Down
12 changes: 1 addition & 11 deletions assetimport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
# Also, assetimport is used directly by a libgcv plugin
cad_enable(ASSETIMPORT "librt;libgcv")

if (NOT ENABLE_ASSETIMPORT AND NOT DISABLE_ASSETIMPORT)

find_package(ASSETIMPORT)

if (NOT ASSETIMPORT_FOUND AND NOT DEFINED ENABLE_ASSETIMPORT)
set(ENABLE_ASSETIMPORT "ON" CACHE BOOL "Enable assetimport build")
endif (NOT ASSETIMPORT_FOUND AND NOT DEFINED ENABLE_ASSETIMPORT)

endif (NOT ENABLE_ASSETIMPORT AND NOT DISABLE_ASSETIMPORT)

set(ENABLE_ASSETIMPORT "${ENABLE_ASSETIMPORT}" CACHE BOOL "Enable assetimport build")
bext_enable(ASSETIMPORT)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions gdal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using GDAL
cad_enable(GDAL "libgcv")

if (NOT ENABLE_GDAL AND NOT DISABLE_GDAL)

find_package(GDAL)

if (NOT GDAL_FOUND AND NOT DEFINED ENABLE_GDAL)
set(ENABLE_GDAL "ON" CACHE BOOL "Enable GDAL build")
endif (NOT GDAL_FOUND AND NOT DEFINED ENABLE_GDAL)

endif (NOT ENABLE_GDAL AND NOT DISABLE_GDAL)

set(ENABLE_GDAL "${ENABLE_GDAL}" CACHE BOOL "Enable GDAL build")
bext_enable(GDAL)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions geogram/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using Geogram
cad_enable(GEOGRAM "librt")

if (NOT ENABLE_GEOGRAM AND NOT DISABLE_GEOGRAM)

find_package(Geogram)

if (NOT Geogram_FOUND AND NOT DEFINED ENABLE_GEOGRAM)
set(ENABLE_GEOGRAM "ON" CACHE BOOL "Enable Geogram build")
endif (NOT Geogram_FOUND AND NOT DEFINED ENABLE_GEOGRAM)

endif (NOT ENABLE_GEOGRAM AND NOT DISABLE_GEOGRAM)

set(ENABLE_GEOGRAM "${ENABLE_GEOGRAM}" CACHE BOOL "Enable Geogram build")
bext_enable(Geogram)

# Decision made, start processing if we are enabled

Expand Down
12 changes: 1 addition & 11 deletions jpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
# wire this into libicv as well if we're going to have it along for the ride...
cad_enable(JPEG "libgcv;libicv")

if (NOT ENABLE_JPEG AND NOT DISABLE_JPEG)

find_package(JPEG)

if (NOT JPEG_FOUND AND NOT DEFINED ENABLE_JPEG)
set(ENABLE_JPEG "ON" CACHE BOOL "Enable jpeg build")
endif (NOT JPEG_FOUND AND NOT DEFINED ENABLE_JPEG)

endif (NOT ENABLE_JPEG AND NOT DISABLE_JPEG)

set(ENABLE_JPEG "${ENABLE_JPEG}" CACHE BOOL "Enable jpeg build")
bext_enable(JPEG)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions lemon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using lemon
cad_enable(LEMON "libgcv;libged")

if (NOT ENABLE_LEMON AND NOT DISABLE_LEMON)

find_package(LEMON)

if (NOT LEMON_FOUND AND NOT DEFINED ENABLE_LEMON)
set(ENABLE_LEMON "ON" CACHE BOOL "Enable lemon build")
endif (NOT LEMON_FOUND AND NOT DEFINED ENABLE_LEMON)

endif (NOT ENABLE_LEMON AND NOT DISABLE_LEMON)

set(ENABLE_LEMON "${ENABLE_LEMON}" CACHE BOOL "Enable lemon build")
bext_enable(LEMON)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions linenoise/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using linenoise
cad_enable(LINENOISE "gtools;nirt")

if (NOT ENABLE_LINENOISE AND NOT DISABLE_LINENOISE)

find_package(LINENOISE)

if (NOT LINENOISE_FOUND AND NOT DEFINED ENABLE_LINENOISE)
set(ENABLE_LINENOISE "ON" CACHE BOOL "Enable linenoise build")
endif (NOT LINENOISE_FOUND AND NOT DEFINED ENABLE_LINENOISE)

endif (NOT ENABLE_LINENOISE AND NOT DISABLE_LINENOISE)

set(ENABLE_LINENOISE "${ENABLE_LINENOISE}" CACHE BOOL "Enable linenoise build")
bext_enable(LINENOISE)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions lmdb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using lmdb
cad_enable(LMDB "libbu")

if (NOT ENABLE_LMDB AND NOT DISABLE_LMDB)

find_package(LMDB)

if (NOT LMDB_FOUND AND NOT DEFINED ENABLE_LMDB)
set(ENABLE_LMDB "ON" CACHE BOOL "Enable lmdb build")
endif (NOT LMDB_FOUND AND NOT DEFINED ENABLE_LMDB)

endif (NOT ENABLE_LMDB AND NOT DISABLE_LMDB)

set(ENABLE_LMDB "${ENABLE_LMDB}" CACHE BOOL "Enable lmdb build")
bext_enable(LMDB)

# Decision made

Expand Down
16 changes: 1 addition & 15 deletions manifold/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# Decide if we're using Manifold
cad_enable(MANIFOLD "librt;libged")

if (NOT ENABLE_MANIFOLD AND NOT DISABLE_MANIFOLD)

# TODO - functionality testing is in order for some of our patches - if
# we do find a system version, but it fails to work the way we need it to,
# it's still a no-go

find_package(MANIFOLD)

if (NOT MANIFOLD_FOUND AND NOT DEFINED ENABLE_MANIFOLD)
set(ENABLE_MANIFOLD "ON" CACHE BOOL "Enable Manifold build")
endif (NOT MANIFOLD_FOUND AND NOT DEFINED ENABLE_MANIFOLD)

endif (NOT ENABLE_MANIFOLD AND NOT DISABLE_MANIFOLD)

set(ENABLE_MANIFOLD "${ENABLE_MANIFOLD}" CACHE BOOL "Enable Manifold build")
bext_enable(MANIFOLD)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions netpbm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using netpbm
cad_enable(NETPBM "libicv")

if (NOT ENABLE_NETPBM AND NOT DISABLE_NETPBM)

find_package(NETPBM)

if (NOT NETPBM_FOUND AND NOT DEFINED ENABLE_NETPBM)
set(ENABLE_NETPBM "ON" CACHE BOOL "Enable netpbm build")
endif (NOT NETPBM_FOUND AND NOT DEFINED ENABLE_NETPBM)

endif (NOT ENABLE_NETPBM AND NOT DISABLE_NETPBM)

set(ENABLE_NETPBM "${ENABLE_NETPBM}" CACHE BOOL "Enable netpbm build")
bext_enable(NETPBM)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions opencv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using opencv
cad_enable(OPENCV "gtools")

if (NOT ENABLE_OPENCV AND NOT DISABLE_OPENCV)

find_package(OPENCV)

if (NOT OPENCV_FOUND AND NOT DEFINED ENABLE_OPENCV)
set(ENABLE_OPENCV "ON" CACHE BOOL "Enable opencv build")
endif (NOT OPENCV_FOUND AND NOT DEFINED ENABLE_OPENCV)

endif (NOT ENABLE_OPENCV AND NOT DISABLE_OPENCV)

set(ENABLE_OPENCV "${ENABLE_OPENCV}" CACHE BOOL "Enable opencv build")
bext_enable(OPENCV)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions openmesh/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using OpenMesh
cad_enable(OPENMESH "libged")

if (NOT ENABLE_OPENMESH AND NOT DISABLE_OPENMESH)

find_package(OPENMESH)

if (NOT OPENMESH_FOUND AND NOT DEFINED ENABLE_OPENMESH)
set(ENABLE_OPENMESH "ON" CACHE BOOL "Enable OpenMesh build")
endif (NOT OPENMESH_FOUND AND NOT DEFINED ENABLE_OPENMESH)

endif (NOT ENABLE_OPENMESH AND NOT DISABLE_OPENMESH)

set(ENABLE_OPENMESH "${ENABLE_OPENMESH}" CACHE BOOL "Enable OpenMesh build")
bext_enable(OPENMESH)

# Decision made

Expand Down
16 changes: 1 addition & 15 deletions opennurbs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# Decide if we're using openNURBS
cad_enable(OPENNURBS "libbrep")

if (NOT ENABLE_OPENNURBS AND NOT DISABLE_OPENNURBS)

find_package(OPENNURBS)

# TODO - functionality testing is in order for some of our patches - if
# we do find a system version, but it fails to work the way we need it to,
# it's still a no-go

if (NOT OPENNURBS_FOUND AND NOT DEFINED ENABLE_OPENNURBS)
set(ENABLE_OPENNURBS "ON" CACHE BOOL "Enable opennurbs build")
endif (NOT OPENNURBS_FOUND AND NOT DEFINED ENABLE_OPENNURBS)

endif (NOT ENABLE_OPENNURBS AND NOT DISABLE_OPENNURBS)

set(ENABLE_OPENNURBS "${ENABLE_OPENNURBS}" CACHE BOOL "Enable opennurbs build")
bext_enable(OPENNURBS)

# Decision made, start processing if we are enabled

Expand Down
12 changes: 1 addition & 11 deletions osmesa/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using osmesa
cad_enable(OSMESA "libdm")

if (NOT ENABLE_OSMESA AND NOT DISABLE_OSMESA)

find_package(OSMESA)

if (NOT OSMESA_FOUND AND NOT DEFINED ENABLE_OSMESA)
set(ENABLE_OSMESA "ON" CACHE BOOL "Enable osmesa build")
endif (NOT OSMESA_FOUND AND NOT DEFINED ENABLE_OSMESA)

endif (NOT ENABLE_OSMESA AND NOT DISABLE_OSMESA)

set(ENABLE_OSMESA "${ENABLE_OSMESA}" CACHE BOOL "Enable osmesa build")
bext_enable(OSMESA)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions perplex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using perplex
cad_enable(PERPLEX "libgcv;libged")

if (NOT ENABLE_PERPLEX AND NOT DISABLE_PERPLEX)

find_package(PERPLEX)

if (NOT PERPLEX_FOUND AND NOT DEFINED ENABLE_PERPLEX)
set(ENABLE_PERPLEX "ON" CACHE BOOL "Enable perplex build")
endif (NOT PERPLEX_FOUND AND NOT DEFINED ENABLE_PERPLEX)

endif (NOT ENABLE_PERPLEX AND NOT DISABLE_PERPLEX)

set(ENABLE_PERPLEX "${ENABLE_PERPLEX}" CACHE BOOL "Enable perplex build")
bext_enable(PERPLEX)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions proj/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using PROJ (needed by GDAL, which is used by gcv)
cad_enable(PROJ "libgcv")

if (NOT ENABLE_PROJ AND NOT DISABLE_PROJ)

find_package(PROJ)

if (NOT PROJ_FOUND AND NOT DEFINED ENABLE_PROJ)
set(ENABLE_PROJ "ON" CACHE BOOL "Enable PROJ build")
endif (NOT PROJ_FOUND AND NOT DEFINED ENABLE_PROJ)

endif (NOT ENABLE_PROJ AND NOT DISABLE_PROJ)

set(ENABLE_PROJ "${ENABLE_PROJ}" CACHE BOOL "Enable PROJ build")
bext_enable(PROJ)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions pugixml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
# is used by Manifold, which is used in librt
cad_enable(PUGIXML "librt")

if (NOT ENABLE_PUGIXML AND NOT DISABLE_PUGIXML)

find_package(PUGIXML)

if (NOT PUGIXML_FOUND AND NOT DEFINED ENABLE_PUGIXML)
set(ENABLE_PUGIXML "ON" CACHE BOOL "Enable pugixml build")
endif (NOT PUGIXML_FOUND AND NOT DEFINED ENABLE_PUGIXML)

endif (NOT ENABLE_PUGIXML AND NOT DISABLE_PUGIXML)

set(ENABLE_PUGIXML "${ENABLE_PUGIXML}" CACHE BOOL "Enable pugixml build")
bext_enable(PUGIXML)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions re2c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using re2c
cad_enable(RE2C "libgcv;libged")

if (NOT ENABLE_RE2C AND NOT DISABLE_RE2C)

find_package(RE2C)

if (NOT RE2C_FOUND AND NOT DEFINED ENABLE_RE2C)
set(ENABLE_RE2C "ON" CACHE BOOL "Enable re2c build")
endif (NOT RE2C_FOUND AND NOT DEFINED ENABLE_RE2C)

endif (NOT ENABLE_RE2C AND NOT DISABLE_RE2C)

set(ENABLE_RE2C "${ENABLE_RE2C}" CACHE BOOL "Enable re2c build")
bext_enable(RE2C)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions regex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using regex
cad_enable(REGEX "librt")

if (NOT ENABLE_REGEX AND NOT DISABLE_REGEX)

find_package(REGEX)

if (NOT REGEX_FOUND AND NOT DEFINED ENABLE_REGEX)
set(ENABLE_REGEX "ON" CACHE BOOL "Enable regex build")
endif (NOT REGEX_FOUND AND NOT DEFINED ENABLE_REGEX)

endif (NOT ENABLE_REGEX AND NOT DISABLE_REGEX)

set(ENABLE_REGEX "${ENABLE_REGEX}" CACHE BOOL "Enable regex build")
bext_enable(REGEX)

# Decision made

Expand Down
12 changes: 1 addition & 11 deletions stepcode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Decide if we're using stepcode
cad_enable(STEPCODE "conv")

if (NOT ENABLE_STEPCODE AND NOT DISABLE_STEPCODE)

find_package(STEPCODE)

if (NOT STEPCODE_FOUND AND NOT DEFINED ENABLE_STEPCODE)
set(ENABLE_STEPCODE "ON" CACHE BOOL "Enable stepcode build")
endif (NOT STEPCODE_FOUND AND NOT DEFINED ENABLE_STEPCODE)

endif (NOT ENABLE_STEPCODE AND NOT DISABLE_STEPCODE)

set(ENABLE_STEPCODE "${ENABLE_STEPCODE}" CACHE BOOL "Enable stepcode build")
bext_enable(STEPCODE)

# Decision made

Expand Down
Loading

0 comments on commit 40ff1b4

Please sign in to comment.