draco_options.cmake - add DRACO_INSTALL option; draco_install.cmake - check DRACO_INSTALL before adding install rules

Co-authored-by: Ondrej Stava <ondys@users.noreply.github.com>
This commit is contained in:
ptc-tgamper 2024-01-12 18:21:19 +01:00 committed by GitHub
parent 74a1435eed
commit a6fddf5e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 84 additions and 78 deletions

View File

@ -23,6 +23,7 @@ include(GNUInstallDirs)
# Sets up the draco install targets. Must be called after the static library
# target is created.
macro(draco_setup_install_target)
if(DRACO_INSTALL)
set(bin_path "${CMAKE_INSTALL_BINDIR}")
set(data_path "${CMAKE_INSTALL_DATAROOTDIR}")
set(includes_path "${CMAKE_INSTALL_INCLUDEDIR}")
@ -118,4 +119,5 @@ macro(draco_setup_install_target)
install(FILES "${draco_build}/draco-config.cmake"
"${draco_build}/draco-config-version.cmake"
DESTINATION "${data_path}/cmake/draco")
endif(DRACO_INSTALL)
endmacro()

View File

@ -131,6 +131,10 @@ macro(draco_set_default_options)
NAME DRACO_DEBUG_COMPILER_WARNINGS
HELPSTRING "Turn on more warnings."
VALUE OFF)
draco_option(
NAME DRACO_INSTALL
HELPSTRING "Enable installation."
VALUE ON)
draco_check_deprecated_options()
endmacro()