Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
example of precompiled header for clion
ADD_LIBRARY(PCH STATIC stdafx.cpp stdafx.h)
ADD_CUSTOM_COMMAND(TARGET PCH
PRE_BUILD
COMMAND ${CMAKE_CXX_COMMAND} -x c++-header ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h -o stdafx.h.pch)
SET_SOURCE_FILES_PROPERTIES(stdafx.cpp
PROPERTIES
COMPILE_FLAGS "-include stdafx.h")
//..
ADD_EXECUTABLE(ProjectFiles ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(ProjectFiles PCH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.