From bcb845434495e293df3d48f1203b7a86e1852449 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dominic=20L=C3=A9tourneau?= Date: Tue, 18 Jun 2024 11:13:08 -0400 Subject: [PATCH] Add ODAS_DISABLE_INSTALL --- CMakeLists.txt | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cab9b71..cc7806e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ endif(COMMAND cmake_policy) option(ODAS_INSTALL_EXECUTABLES "Install the odaslive and odasserver executables along with the odas library" OFF) option(ODAS_FORCE_BIN_AND_LIB_DIRS "Force the installation of the odas library and executables in the bin and lib directories" ON) +option(ODAS_DISABLE_INSTALL "Disable the installation of the odas library and executables" OFF) + find_package(PkgConfig REQUIRED) pkg_check_modules(PC_FFTW3 REQUIRED fftw3f) @@ -224,19 +226,22 @@ target_link_libraries(odasserver odas ) -install(TARGETS odas LIBRARY DESTINATION lib) -install( - DIRECTORY include/ - DESTINATION include - FILES_MATCHING - PATTERN "*.h" -) - -if(ODAS_INSTALL_EXECUTABLES) - install(TARGETS odaslive DESTINATION bin) - install(TARGETS odasserver DESTINATION bin) +if (NOT ODAS_DISABLE_INSTALL) + install(TARGETS odas LIBRARY DESTINATION lib) + install( + DIRECTORY include/ + DESTINATION include + FILES_MATCHING + PATTERN "*.h" + ) + + if(ODAS_INSTALL_EXECUTABLES) + install(TARGETS odaslive DESTINATION bin) + install(TARGETS odasserver DESTINATION bin) + endif() endif() + if(ODAS_FORCE_BIN_AND_LIB_DIRS) unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY) -- 2.34.1