0

I am maintaining an old project, and find following statements in CMakeList.txt:

set (CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS} -pg") 
set (CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS} -pg")

But I can't find these variable definitions in my current cmake:

# cmake --help-variable-list | grep PROFILE
#

My cmake version is 3.7.2:

# cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

So are CMAKE_CXX_FLAGS_PROFILE and CMAKE_EXE_LINKER_FLAGS_PROFILE deprecated? If they existed, what is the function of them?

Nan Xiao
  • 16,671
  • 18
  • 103
  • 164

1 Answers1

2

If we are talking about makefile generators you can just do

cmake -DCMAKE_BUILD_TYPE=Profile ..

Anyone can invent new configuration types in their project as in this case it seems to have been done.

Just a hint: The code could even be simplified since the flags will anyway be concatenated like CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_PROFILE.

Reference

Florian
  • 39,996
  • 9
  • 133
  • 149