]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Allow library installation to be disabled in CMake
authorXiao-Long Chen <chenxiaolong@cxl.epac.to>
Fri, 23 Jan 2015 20:12:11 +0000 (15:12 -0500)
committerXiao-Long Chen <chenxiaolong@cxl.epac.to>
Fri, 23 Jan 2015 20:16:57 +0000 (15:16 -0500)
CMakeLists.txt
build/cmake/CreatePkgConfigFile.cmake
libarchive/CMakeLists.txt

index a9d2531e21908bbff9bc3d836e3733b49ba06eba..4974d7671d565139aa3f89c9fc4b7daca60c51e7 100644 (file)
@@ -181,6 +181,7 @@ OPTION(ENABLE_ACL "Enable ACL support" ON)
 OPTION(ENABLE_ICONV "Enable iconv support" ON)
 OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
 OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE)
+OPTION(ENABLE_INSTALL "Enable installing of libraries" ON)
 
 SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support")
 SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)")
index f96bbef00f5b71b6f32ad7f1effa6d05dabaaba8..fc8529a571f2833310199d6f8cbb0a48022c04b7 100644 (file)
@@ -27,5 +27,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc.in
                ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
                @ONLY)
 # And install it, of course ;).
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
-       DESTINATION "lib/pkgconfig")
+IF(ENABLE_INSTALL)
+  INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc
+          DESTINATION "lib/pkgconfig")
+ENDIF()
index 140e75b2d6d5a9fb7b2eac3bab63962c6c32885e..db847c109f89435c62b18d980ff94575834c192e 100644 (file)
@@ -203,12 +203,14 @@ IF(NOT WIN32 OR CYGWIN)
   SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive)
 ENDIF(NOT WIN32 OR CYGWIN)
 
-# How to install the libraries
-INSTALL(TARGETS archive archive_static
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib)
-INSTALL_MAN(${libarchive_MANS})
-INSTALL(FILES ${include_HEADERS} DESTINATION include)
+IF(ENABLE_INSTALL)
+  # How to install the libraries
+  INSTALL(TARGETS archive archive_static
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib
+          ARCHIVE DESTINATION lib)
+  INSTALL_MAN(${libarchive_MANS})
+  INSTALL(FILES ${include_HEADERS} DESTINATION include)
+ENDIF()
 
 add_subdirectory(test)