3 include_directories(${PROJECT_SOURCE_DIR}/basic_finite_elements/src)
5 if(MoFEM_PRECOMPILED_HEADRES)
7 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
8 set(OUT_PCH_SUFFIX "pch")
9 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
10 set(OUT_PCH_SUFFIX "gch")
13 # BasicFiniteElements.hpp
14 set_source_files_properties(
15 ${PROJECT_SOURCE_DIR}/basic_finite_elements/src/BasicFiniteElements.hpp
18 COMPILE_FLAGS "-x c++-header"
21 BasicFiniteElements.hpp.pch
23 ${PROJECT_SOURCE_DIR}/basic_finite_elements/src/BasicFiniteElements.hpp
26 BasicFiniteElements.hpp.pch_copy
27 ${CMAKE_COMMAND} -E copy_if_different
28 ${PROJECT_BINARY_DIR}/CMakeFiles/BasicFiniteElements.hpp.pch.dir/basic_finite_elements/src/BasicFiniteElements.hpp.o
29 ${PROJECT_BINARY_DIR}/basic_finite_elements/src/precompile/BasicFiniteElements.hpp.${OUT_PCH_SUFFIX}
31 ${CMAKE_COMMAND} -E copy_if_different
32 ${PROJECT_SOURCE_DIR}/basic_finite_elements/src/BasicFiniteElements.hpp
33 ${PROJECT_BINARY_DIR}/basic_finite_elements/src/precompile/BasicFiniteElements.hpp
35 "Copy precompiled BasicFiniteElements.hpp header"
37 add_dependencies(BasicFiniteElements.hpp.pch_copy BasicFiniteElements.hpp.pch)
39 endif(MoFEM_PRECOMPILED_HEADRES)
41 set(PERCOMPILED_HEADER
42 ${PROJECT_BINARY_DIR}/basic_finite_elements/src/precompile/BasicFiniteElements.hpp)
44 function(bfe_add_executable target source)
45 if(MoFEM_PRECOMPILED_HEADRES)
46 set_source_files_properties(${source} PROPERTIES COMPILE_FLAGS "-include ${PERCOMPILED_HEADER}")
47 endif(MoFEM_PRECOMPILED_HEADRES)
48 add_executable(${target} ${source})
49 if(MoFEM_PRECOMPILED_HEADRES)
50 add_dependencies(${target} BasicFiniteElements.hpp.pch_copy)
51 endif(MoFEM_PRECOMPILED_HEADRES)
52 endfunction(bfe_add_executable)