# CMake: reproduce the WebKitGTK building phases within a CMakeLists.txt ?

**URL:** https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659
**Category:** Usage
**Tags:** os:linux, gen:makefiles, gen:ninja
**Created:** [December 17, 2023, 7:13pm UTC](https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659 "2023-12-17T19:13:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Raphy](https://discourse.cmake.org/user_avatar/discourse.cmake.org/raphy/32/4087_2.png) [@Raphy](https://discourse.cmake.org/u/Raphy)
#### Post date: [December 17, 2023, 7:13pm UTC](https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659/1 "2023-12-17T19:13:16Z")

</div>

With this `CMakeLists.txt` file:

```
include(FetchContent)
FetchContent_Declare(
  WebKit2
  #URL https://webkitgtk.org/releases/webkitgtk-2.42.3.tar.xz
  GIT_REPOSITORY https://github.com/raphael10-collab/webkitgtkIncludable.git
)
FetchContent_MakeAvailable(webkit2)
add_executable(my_application src/main.cpp)

target_link_libraries(my_application PRIVATE $webkit2:$webkit2)

```

I not get errors but I do not get also any output :

```
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 (5.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/slint/cpp-base-slint/build

```

No output of the building process :

```
raphy@raohy:~/slint/cpp-base-slint/build/_deps$ ls -lah
total 20K
drwxrwxr-x 5 raphy raphy 4,0K dic 17 13:12 .
drwxrwxr-x 4 raphy raphy 4,0K dic 17 13:12 ..
drwxrwxr-x 2 raphy raphy 4,0K dic 17 13:12 webkit2-build
drwxrwxr-x 3 raphy raphy 4,0K dic 17 13:12 webkit2-src
drwxrwxr-x 4 raphy raphy 4,0K dic 17 13:12 webkit2-subbuild
raphy@raohy:~/slint/cpp-base-slint/build/_deps$ 

raphy@raohy:~/slint/cpp-base-slint/build/_deps/webkit2-src$ ls -lah
total 31M
drwxrwxr-x 3 raphy raphy 4,0K dic 17 13:12 .
drwxrwxr-x 5 raphy raphy 4,0K dic 17 13:12 ..
drwxrwxr-x 8 raphy raphy 4,0K dic 17 13:12 .git
-rw-rw-r-- 1 raphy raphy 31M dic 17 13:12 webkitgtk-2.42.3.tar.xz

raphy@raohy:~/slint/cpp-base-slint/build/_deps/webkit2-subbuild$ ls -lah
total 40K
drwxrwxr-x 4 raphy raphy 4,0K dic 17 13:12 .
drwxrwxr-x 5 raphy raphy 4,0K dic 17 13:12 ..
-rw-rw-r-- 1 raphy raphy 4,5K dic 17 13:12 CMakeCache.txt
drwxrwxr-x 5 raphy raphy 4,0K dic 17 13:12 CMakeFiles
-rw-rw-r-- 1 raphy raphy 1,6K dic 17 13:12 cmake_install.cmake
-rw-r--r-- 1 raphy raphy 1,8K dic 17 13:12 CMakeLists.txt
-rw-rw-r-- 1 raphy raphy 4,7K dic 17 13:12 Makefile
drwxrwxr-x 4 raphy raphy 4,0K dic 17 13:12 webkit2-populate-prefix

raphy@raohy:~/slint/cpp-base-slint/build/_deps/webkit2-build$ ls -lah
total 8,0K
drwxrwxr-x 2 raphy raphy 4,0K dic 17 13:12 .
drwxrwxr-x 5 raphy raphy 4,0K dic 17 13:12 ..

```

My objective is to reproduce the WebKitGTK building phases within a CMakeLists.txt

How to make it work?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 19, 2023, 12:31pm UTC](https://discourse.cmake.org/t/cmake-reproduce-the-webkitgtk-building-phases-within-a-cmakelists-txt/9659/2 "2023-12-19T12:31:01Z")

</div>

I believe this was answered here:

> [@CMake Error: include could not find requested file: WebKitCommon](https://discourse.cmake.org/t/cmake-error-include-could-not-find-requested-file-webkitcommon/9645):
>
> I compiled and installed in Ubuntu 22.04 WebKitGTK : [BuildingGtk – WebKit](https://trac.webkit.org/wiki/BuildingGtk#BuildingWebKitGTKfromareleasetarball) Now I would like to do the same with find\_package and FetchContent in another CmakeLists.txt in order to download it and build it locally: cmake\_minimum\_required(VERSION 3.21) project(my\_application LANGUAGES CXX) find\_package(webkit2 QUIET) if (NOT webkit2\_FOUND) message("webkit2 could not be located in CMake module search path. Downloading it, and building it locally") include(FetchContent) FetchContent\_Decl…
