summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-21 04:21:52 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-22 13:24:49 (GMT)
commit7df955315b6de04333c3c23a1601e3af4911ed32 (patch)
tree9a4b6d4ec2d90e053756fea3b1a5c3120f08064c
parent626136ad4dbf13f560d8c55c5d50f0488e8db966 (diff)
downloadCMake-7df955315b6de04333c3c23a1601e3af4911ed32.zip
CMake-7df955315b6de04333c3c23a1601e3af4911ed32.tar.gz
CMake-7df955315b6de04333c3c23a1601e3af4911ed32.tar.bz2
Build: Add `ENABLE_BUILD_FREEBSD_PKG` to `cmCPackConfigure.h`
-rw-r--r--Source/CMakeLists.txt10
-rw-r--r--Source/CPack/cmCPackConfigure.h.in1
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx4
3 files changed, 7 insertions, 8 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2cf4d1c..ec581e8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1049,7 +1049,6 @@ target_include_directories(
target_link_libraries(CPackLib PUBLIC CMakeLib)
option(CPACK_ENABLE_FREEBSD_PKG "Add FreeBSD pkg(8) generator to CPack." OFF)
-
if(UNIX)
target_sources(
CPackLib
@@ -1070,7 +1069,10 @@ if(UNIX)
pkg
DOC "FreeBSD pkg(8) library")
if(FREEBSD_PKG_LIBRARIES)
+ set(ENABLE_BUILD_FREEBSD_PKG 1)
target_sources(CPackLib PUBLIC CPack/cmCPackFreeBSDGenerator.cxx)
+ target_include_directories(CPackLib PUBLIC ${FREEBSD_PKG_INCLUDE_DIRS})
+ target_link_libraries(CPackLib PUBLIC ${FREEBSD_PKG_LIBRARIES})
endif()
endif()
@@ -1151,11 +1153,7 @@ if(APPLE)
"See CMakeFiles/CMakeError.log for details of the failure.")
endif()
endif()
-if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARIES)
- target_include_directories(CPackLib PUBLIC ${FREEBSD_PKG_INCLUDE_DIRS})
- target_link_libraries(CPackLib PUBLIC ${FREEBSD_PKG_LIBRARIES})
- target_compile_definitions(CPackLib PUBLIC HAVE_FREEBSD_PKG)
-endif()
+
# Render config header file for CPackLib
configure_file(CPack/cmCPackConfigure.h.in CPack/cmCPackConfigure.h)
diff --git a/Source/CPack/cmCPackConfigure.h.in b/Source/CPack/cmCPackConfigure.h.in
index 128784a..a5e36d3 100644
--- a/Source/CPack/cmCPackConfigure.h.in
+++ b/Source/CPack/cmCPackConfigure.h.in
@@ -3,3 +3,4 @@
#pragma once
#cmakedefine01 ENABLE_BUILD_WIX_GENERATOR
+#cmakedefine01 ENABLE_BUILD_FREEBSD_PKG
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index ef58870..efb94b9 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -6,7 +6,7 @@
#include <utility>
#include "IFW/cmCPackIFWGenerator.h"
-#ifdef HAVE_FREEBSD_PKG
+#if ENABLE_BUILD_FREEBSD_PKG
# include "cmCPackFreeBSDGenerator.h"
#endif
#include "cmCPackArchiveGenerator.h"
@@ -119,7 +119,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
cmCPackRPMGenerator::CreateGenerator);
}
#endif
-#ifdef HAVE_FREEBSD_PKG
+#if ENABLE_BUILD_FREEBSD_PKG
if (cmCPackFreeBSDGenerator::CanGenerate()) {
this->RegisterGenerator("FREEBSD", "FreeBSD pkg(8) packages",
cmCPackFreeBSDGenerator::CreateGenerator);