Being the CMakeLists.txt
of the git-cloned webkitgtk in the sub-folder webkitgtk-2.42.3
:
/build/_deps/webkit2-src/webkitgtk-2.42.3$ ls -lah
total 140K
drwxrwxr-x 5 raphy raphy 4,0K dic 20 11:44 .
drwxrwxr-x 4 raphy raphy 4,0K dic 20 11:44 ..
-rw-rw-r-- 1 raphy raphy 2,0K dic 20 11:44 CMakeLists.txt
drwxrwxr-x 5 raphy raphy 4,0K dic 20 11:44 Documentation
-rw-rw-r-- 1 raphy raphy 115K dic 20 11:44 NEWS
drwxrwxr-x 12 raphy raphy 4,0K dic 20 11:44 Source
drwxrwxr-x 6 raphy raphy 4,0K dic 20 11:44 Tools
I defined SOURCE_SUBDIR webkitgtk-2.42.3,
and specified WebKitCommon as target_link_library:
include(FetchContent)
FetchContent_Declare(
WebKit2
GIT_REPOSITORY https://github.com/raphael10-collab/webkitgtkIncludable.git
SOURCE_SUBDIR webkitgtk-2.42.3
)
FetchContent_MakeAvailable(webkit2)
add_executable(webkit2 src/main.cpp)
target_link_libraries(WebKitCommon WebKitCommon)
But get these two errors: include could not find requested file: WebKitCommon
and Unknown CMake command "WEBKIT_FRAMEWORK_DECLARE"
cmake -B build
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at build/_deps/webkit2-src/webkitgtk-2.42.3/CMakeLists.txt:14 (cmake_policy):
The OLD behavior for policy CMP0116 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Error at build/_deps/webkit2-src/webkitgtk-2.42.3/CMakeLists.txt:21 (include):
include could not find requested file:
WebKitCommon
CMake Error at build/_deps/webkit2-src/webkitgtk-2.42.3/Source/bmalloc/CMakeLists.txt:698 (WEBKIT_FRAMEWORK_DECLARE):
Unknown CMake command "WEBKIT_FRAMEWORK_DECLARE".
-- Configuring incomplete, errors occurred!
The CMakeLists.txt of webkitgtk actually looks for including WebKitCommon: https://github.com/raphael10-collab/webkitgtkIncludable/blob/master/webkitgtk-2.42.3/CMakeLists.txt#L21
I commented the line above: https://github.com/raphael10-collab/webkitgtkIncludable/blob/master/webkitgtk-2.42.3/CMakeLists.txt#L20C1-L20C1 :
#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
which assumes that webkit2 is the top level project
I tried also with FetchContent_Populate
:
include(FetchContent)
FetchContent_Declare(
WebKit2
GIT_REPOSITORY https://github.com/raphael10-collab/webkitgtkIncludable.git
SOURCE_SUBDIR webkitgtk-2.42.3
)
FetchContent_Populate(webkit2)
#FetchContent_MakeAvailable(webkit2)
add_executable(webkit2 src/main.cpp)
but I get no output in /build/_deps/webkit2-build/
folder :
cmake -B build
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (8.4s)
-- Generating done (0.0s)
/build/_deps/webkit2-build$ ls -lah
total 8,0K
drwxrwxr-x 2 raphy raphy 4,0K dic 20 13:14 .
drwxrwxr-x 5 raphy raphy 4,0K dic 20 13:14 .