How is one supposed to properly use CMake for setting build configurations in a cross-platform way?
Currently i do this:
set(BUILD32 false)
if(BUILD32)
set(CMAKE_C_FLAGS -m32)
set(CMAKE_CXX_FLAGS -m32)
endif()
But from what i've googled that's bad and i should be using 'generator expressions'. I've found this: CMAKE_BUILD_TYPE not being used in CMakeLists.txt
that says to use:
target_compile_definitions(MyTarget PUBLIC "$<$<CONFIG:Debug>:MYDEBUG_MACRO>")
But i'm not sure how the CONFIG:Debug is supposed to be set, or what the MYDEBUG_MACRO is supposed to be.
All i want is an option the ability to compile in release, debug, and x86/x64 variations of those two for both makefiles and Visual studio.
I appreciate any help.