Compiling nginx using CLion (via CMake)

I'm trying to compile nginx 1.9.5 via CLion for debugging purposes.

Because CLion doesn't currently support vanilla Makefiles/Autoconf I ran the autoconf auto/configure script to generate a valid Makefile, opened the project in CLion, then made a very simple CMakeLists.txt to delegate the CLion build to the autoconf generated Makefile (as advised by Using local makefile for CLion instead of CMake).

Unfortunately, my simple CMakeLists.txt seems to have a flaw, as when I reload and run CLion's build command, CMake seems to generate yet a new Makefile and run this empty Make task instead of running the one in ${nginx_SOURCE_DIR}.

How can I change the CMakeLists.txt file below to delegate to the nginx Makefile instead of regenerating 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})
链接地址: http://www.djcxy.com/p/24466.html

上一篇: CMake重写本地编译器标志

下一篇: 使用CLion编译nginx(通过CMake)