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

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

时间:2023-01-09 14:11:57浏览次数:48  
标签:SET CMAKE CXX Wall FLAGS 版本 release cmake DIR

 

 

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 

 

标签:SET,CMAKE,CXX,Wall,FLAGS,版本,release,cmake,DIR
From: https://www.cnblogs.com/lishanyang/p/17036883.html

相关文章