Include CPack only when explictly packaging (#5817)
authora-maurice <amaurice@google.com>
Tue, 17 Mar 2020 20:38:29 +0000 (13:38 -0700)
committerGitHub <noreply@github.com>
Tue, 17 Mar 2020 20:38:29 +0000 (13:38 -0700)
Including CPack without the additional packaging information creates unused project files, and can potentially cause issues for projects including Flatbuffers that also use CPack.

CMakeLists.txt

index 3987eac..913c563 100644 (file)
@@ -619,9 +619,10 @@ if(UNIX)
     # Use of CPack only supported on Linux systems.
     if(FLATBUFFERS_PACKAGE_DEBIAN)
         include(CMake/PackageDebian.cmake)
+        include(CPack)
     endif()
     if (FLATBUFFERS_PACKAGE_REDHAT)
         include(CMake/PackageRedhat.cmake)
+        include(CPack)
     endif()
-    include(CPack)
 endif()