A
A
Anton2017-08-03 10:28:07
CMake
Anton, 2017-08-03 10:28:07

How to add custom build type to cmake?

I want to add my build type to cmake and call cmake like this:
cmake -DCMAKE_BUILD_TYPE=mytype
In CMakeLists.txt I added the following lines:

set(CMAKE_CXX_FLAGS_DEBUG "-fPIC -o0 -g")
set(CMAKE_CXX_FLAGS_MYTYPE "-fPIC -o0 -g -m32")
set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -o3)

Judging by the documentation, this is enough, but the project is still compiled with the CMAKE_CXX_FLAGS_DEBUG flags.
What else do I need to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2017-08-03
@Riki-tiki-tavi

Try putting these sets before the project directive, sometimes it helps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question