mirror of
https://git.freebsd.org/ports.git
synced 2025-05-29 09:26:27 -04:00
78 lines
3 KiB
Text
78 lines
3 KiB
Text
--- CMakeLists.txt.orig 2023-03-12 06:35:07 UTC
|
|
+++ CMakeLists.txt
|
|
@@ -38,27 +38,7 @@ endif()
|
|
|
|
set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR}/external)
|
|
|
|
-# cJSON and cJSONUtils
|
|
-ExternalProject_Add(cjson
|
|
- GIT_REPOSITORY "https://github.com/DaveGamble/cJSON"
|
|
- GIT_TAG "v1.7.15"
|
|
- PREFIX "${EXTERNAL_DIR}/cJSON"
|
|
- BUILD_IN_SOURCE 1
|
|
- TEST_COMMAND ""
|
|
- INSTALL_COMMAND ""
|
|
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
- -DBUILD_SHARED_AND_STATIC_LIBS=On
|
|
- -DBUILD_SHARED_LIBS=Off
|
|
- -DENABLE_CJSON_TEST=Off
|
|
- -DENABLE_CJSON_UTILS=On
|
|
- -DENABLE_TARGET_EXPORT=On
|
|
- )
|
|
-ExternalProject_Get_Property(cjson source_dir)
|
|
-ExternalProject_Get_Property(cjson binary_dir)
|
|
-ExternalProject_Get_Property(cjson download_dir)
|
|
-set(CJSON_SOURCE_DIR "${source_dir}")
|
|
-set(CJSON_BINARY_DIR "${binary_dir}")
|
|
-set(CJSON_DOWNLOAD_DIR "${download_dir}")
|
|
+# cJSON and cJSONUtils installed from devel/libcjson
|
|
|
|
# beectl
|
|
set(BEECTL_SRCS
|
|
@@ -69,21 +49,13 @@ set(BEECTL_SRCS
|
|
src/mkstemps.c
|
|
# This is nasty, but I couldn't find a way to use CMAKE_TOOLCHAIN_FILE
|
|
# for the external project (see comments below.)
|
|
- "${CJSON_SOURCE_DIR}/cJSON.c"
|
|
)
|
|
|
|
add_executable(beectl ${BEECTL_SRCS})
|
|
|
|
-# Workaround for CMake versions which require the cJSON.c file to exist before
|
|
-# downloading the external project.
|
|
-add_custom_command(TARGET beectl PRE_BUILD
|
|
- BYPRODUCTS "${CJSON_SOURCE_DIR}/cJSON.c"
|
|
- COMMAND touch "${CJSON_SOURCE_DIR}/cJSON.c")
|
|
-
|
|
target_compile_features(beectl PRIVATE c_variadic_macros)
|
|
target_include_directories(beectl PRIVATE "${CJSON_DOWNLOAD_DIR}")
|
|
set_property(TARGET beectl PROPERTY C_STANDARD 11) # C11
|
|
-add_dependencies(beectl cjson)
|
|
|
|
# The following would be better approach than including cJSON files in our
|
|
# source list. But the build fails when cross-compiling, since
|
|
@@ -110,13 +82,13 @@ string(TOUPPER "${CMAKE_SYSTEM_NAME}" uppercase_CMAKE_
|
|
|
|
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
|
set(BEECTL_MANIFEST_TARGET_PATH "${CMAKE_INSTALL_PREFIX}/bin/beectl")
|
|
-set(BEECTL_CHROME_MANIFEST_DIR "etc/opt/chrome/native-messaging-hosts")
|
|
+set(BEECTL_CHROME_MANIFEST_DIR "etc/chrome/native-messaging-hosts")
|
|
|
|
if(uppercase_CMAKE_SYSTEM_NAME MATCHES LINUX AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd|x86_)64$")
|
|
# Fedora 36 amd64 may have a separate /usr/lib64 dir different from /usr/lib.
|
|
set(BEECTL_FIREFOX_MANIFEST_DIR "usr/lib64/mozilla/native-messaging-hosts")
|
|
else()
|
|
- set(BEECTL_FIREFOX_MANIFEST_DIR "usr/lib/mozilla/native-messaging-hosts")
|
|
+ set(BEECTL_FIREFOX_MANIFEST_DIR "lib/mozilla/native-messaging-hosts")
|
|
endif()
|
|
|
|
# RPM package properties
|
|
@@ -238,7 +210,7 @@ elseif(uppercase_CMAKE_SYSTEM_NAME MATCHES DARWIN)
|
|
COMPONENT config)
|
|
else(uppercase_CMAKE_SYSTEM_NAME MATCHES WINDOWS)
|
|
# Install host app
|
|
- install(TARGETS beectl RUNTIME DESTINATION usr/local/bin COMPONENT applications)
|
|
+ install(TARGETS beectl RUNTIME DESTINATION bin COMPONENT applications)
|
|
|
|
configure_file(
|
|
chrome-com.ruslan_osmanov.bee.json.in
|