cmake生成debug和release两个版本程序(如何编译-g版本)

 

 

PROJECT(main)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_SOURCE_DIR .)

SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

AUX_SOURCE_DIRECTORY(. DIR_SRCS)
ADD_EXECUTABLE(main ${DIR_SRCS})

 

 

# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5

# compile C with /usr/bin/cc
# compile CXX with /usr/bin/c++
C_FLAGS = -g  

C_DEFINES = 

C_INCLUDES = -I/home/samba/math 

CXX_FLAGS =  -O0 -Wall -g -ggdb  

CXX_DEFINES = 

CXX_INCLUDES = -I/home/samba/math 

 

posted @ 2023-01-09 14:05  羊大葱  阅读(756)  评论(0编辑  收藏  举报