Appending to CMAKE_C_FLAGS
问题 I'm using CMake for a project that comes in two versions, one of which requires -lglapi and the other does not. So far the lines we used look like that: SET(CMAKE_C_FLAGS "-O3 -xSSE3 -restrict -lpthread -lX11 -ldrm") SET(CMAKE_CXX_FLAGS "-O3 -xSSE3 -restrict -lpthread -lX11 -ldrm") I added an if statement in my CMakeList.txt exactly after those lines: if(SINGLE_MODE) SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} " -lglapi") SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -lglapi") endif(SINGLE_MODE) The SINGLE