How do I add flags like -lm
(for math.h) in Clion to build and run a c file?
I basically want to use pow()
function from math.h
in my code and run and debug the same in Clion.
I'm new to CMake.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.5)
project(Assign2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.c)
add_executable(Assign2 ${SOURCE_FILES})