im trying to use cmake with the following compile options using add_compile_options : add_compile_options(-pipe -O2 -std=c++98 -W -Wall -pedantic)
But it does not seem to be actually used during the compilation.
make -n | grep pedantic
does not return anything
Just for information, my cmake command and what it returns :
cmake -G"Unix Makefiles" -DARCH:STRING=x86 -Bosef -H. -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- cmake run for linux x86
-- Configuring done
-- Generating done
-- Build files have been written to: /home/davidlevy/WS/LC4/main/osef
What can I do to actually have the options applied?
PS : I noticed they were not applied because make does not output a single warning
EDIT : If instead I use
set (
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} "
"${CMAKE_CXX_FLAGS} -pipe -O2 -std=c++98 -W -Wall -pedantic"
)
Make does /usr/bin/g++ ; -pipe -O2 -std=c++98 -W -Wall -pedantic -I ENDOFTHECOMMAND
I dont know where does this ; comes from