From 7d536ceeb626180cea576cc85067f3e269539e74 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 21 Apr 2023 17:50:43 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 21 +++++++++++++-------- source/ubl-settings-bootloader.h.in | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 source/ubl-settings-bootloader.h.in diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index be4d54f..a8e6163 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -10,20 +10,21 @@ add_definitions(${GTK_CFLAGS_OTHER}) find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) -if(DEFINED WEBKIT_LIBRARIES_FOUND) - option(WEBKIT_FOUND "is webkit found" ON) - message("WEBKIT FOUND") +option(WEBKIT_FOUND "No" OFF) + +find_library(WEBKIT_LIBRARIES_FOUND webkit2gtk-4.0 webkit2gtk-web-extension-4.0) +message("${WEBKIT_LIBRARIES_FOUND}") +if(WEBKIT_LIBRARIES_FOUND) + option(WEBKIT_FOUND "Yes" ON) + message("Webkit is located at ${WEBKIT_LIBRARIES_FOUND}") PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0) include_directories(${WEBKIT_INCLUDE_DIRS}) link_directories(${WEBKIT_LIBRARY_DIRS}) add_definitions(${WEBKIT_CFLAGS_OTHER}) endif() +configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h) -pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0 webkit2gtk-web-extension-4.0) -include_directories(${WEBKIT_INCLUDE_DIRS}) -link_directories(${WEBKIT_LIBRARY_DIRS}) -add_definitions(${WEBKIT_CFLAGS_OTHER}) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ @@ -52,5 +53,9 @@ set(LIBRARIES pthread) add_executable(ubl-settings-bootloader ${SOURCE_FILES}) -target_link_libraries(ubl-settings-bootloader ${LIBRARIES} ${WEBKIT_LIBRARIES}) +if(WEBKIT_LIBRARIES_FOUND) + target_link_libraries(ubl-settings-bootloader ${LIBRARIES} ${WEBKIT_LIBRARIES}) +else() + target_link_libraries(ubl-settings-bootloader ${LIBRARIES}) +endif() install(TARGETS ubl-settings-bootloader DESTINATION bin) diff --git a/source/ubl-settings-bootloader.h.in b/source/ubl-settings-bootloader.h.in new file mode 100644 index 0000000..17ba454 --- /dev/null +++ b/source/ubl-settings-bootloader.h.in @@ -0,0 +1 @@ +#cmakedefine WEBKIT_FOUND \ No newline at end of file