Compiling nginx using CLion (via CMake)

I am trying to compile nginx 1.9.5 through CLion for debugging purposes.

Since CLion does not currently support vanilla Makefiles / Autoconf, I ran the autoconf auto/configure script to generate a valid Makefile, opened the project in CLion, and then made a very simple CMakeLists.txt to delegate the CLion assembly autoconf generated by the Makefile (as recommended Using a local makefile for CLion instead of CMake ).

Unfortunately, my simple CMakeLists.txt has a flaw, because when I reload and run the CLion build command, CMake seems to generate another new Makefile and run this empty Make task instead of running it in $ {nginx_SOURCE_DIR}.

How can I modify the CMakeLists.txt file below to be delegated to the nginx makefile instead of restoring a new one?

 cmake_minimum_required(VERSION 2.8.4) project(nginx) add_custom_target(nginx ALL COMMAND make -C ${nginx_SOURCE_DIR} CLION_EXE_DIR=${PROJECT_BINARY_DIR}) 
+5
source share

Source: https://habr.com/ru/post/1232377/


All Articles