CMAKE Define Variable
已回答
This is a CMAKE issue. I have a program that contains this kind of switches within the c code.
#ifndef NOGRAVITY
...
#endif
In the original Makefile
OPT += -DNOGRAVITY
OPTIONS = $(OPTIMIZE) $(OPT)
CFLAGS = $(OPTIONS) $(GSL_INCL) $(FFTW_INCL) $(HDF5INCL)
Since it affects CFLAGS I added this to the CMAKFIles.txt
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNEQUALSOFTENINGS -DPEANOHILBERT -DWALLCLOCK -DSYNCHRONIZATION -DPMGRID=128")
it does not work.
How to pass these flags to the compiler?
请先登录再写评论。
Hi! The add_definitions CMake command is intended to add preprocessor definitions (see the add_compile_options() command to add other flags). It adds definitions to the compiler command line for targets in the current directory and below (whether added before or after this command is invoked). Also there is the target_compile_definitions command which adds compile definitions to a target.