cryptopp-cmake
cryptopp-cmake copied to clipboard
dont double-add CRYPTOPP_COMPILE_DEFINITIONS
Otherwise, if you run
cmake -D DISABLE_ASM=ON . && make VERBOSE=1
you will get a compiler invocation like
/usr/bin/c++ -DCRYPTOPP_DISABLE_ASM -O2 -g -DNDEBUG -fPIC CRYPTOPP_DISABLE_ASM -o CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o -c /path/cryptopp/cryptlib.cpp
with "c++: error: CRYPTOPP_DISABLE_ASM" file not found (it is twice in the command line options, once with -D and once without it).
This should fix it.
Thanks @lawidog.
Would it be better to fix the cause of CRYPTOPP_DISABLE_ASM
(instead of -DCRYPTOPP_DISABLE_ASM
)?
I am not sure I understand your question. I believe that the list CRYPTOPP_COMPILE_DEFINITIONS is correctly filled (just a list of options without -D prefix). That means it can be added used with add_compile_definitions(). But it must not be added using add_compile_options(), as that would require to add the prefix -D to each option beforehand.
This should be fixed in the latest master branch - please check.