I have project where I need some specific preprocessor definitions. Nothing less nothing more. I tried various solutions:
set(DEFINES MY_DEFINE)
target_compile_definitions(my_target PRIVATE ${DEFINES})
and
set(DEFINES -DMY_DEFINE)
add_definitions(${DEFINES})
even
set(DEFINES MY_DEFINE)
set_property(TARGET my_target PROPERTY CACHE COMPILE_DEFINITIONS ${DEFINES})
Every time cmake still injects some other defines:
WIN32
_WINDOWS
CMAKE_INTDIR="$(CONFIG)"
My target is static library and project generator is Visual Studio 2015 if it might influence anything. How can I get cmake to set only my defines?