Add ODAS_DISABLE_INSTALL master
authorDominic Létourneau <dominic.letourneau@usherbrooke.ca>
Tue, 18 Jun 2024 15:13:08 +0000 (11:13 -0400)
committerDominic Létourneau <dominic.letourneau@usherbrooke.ca>
Tue, 18 Jun 2024 15:13:08 +0000 (11:13 -0400)
CMakeLists.txt

index cab9b71ccf6258cb5fee21f76991ea8e853cbf59..cc7806e7a10a44d1d8183a1ddf94e6c41a5a4620 100644 (file)
@@ -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_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)
 
 find_package(PkgConfig REQUIRED)
 pkg_check_modules(PC_FFTW3 REQUIRED fftw3f)
@@ -224,19 +226,22 @@ target_link_libraries(odasserver
     odas
 )
 
     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()
 
 endif()
 
+
 if(ODAS_FORCE_BIN_AND_LIB_DIRS)
     unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
     unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
 if(ODAS_FORCE_BIN_AND_LIB_DIRS)
     unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
     unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY)