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