e945cdd19b9bd89f307b9c8845b8c6d68631bed3
[alexxy/gromacs.git] / cmake / gmxDetectTargetArchitecture.cmake
1 # - Define function to detect whether the compiler's target
2 # - architecture is one for which GROMACS has special treatment
3 # - (e.g. kernel acceleration)
4 #
5 # Sets GMX_TARGET_X86 or GMX_TARGET_BGQ if targetting that
6 # architecture. May set other such variables if/when there is future
7 # need.
8
9 function(gmx_detect_target_architecture)
10     if (NOT DEFINED GMX_TARGET_X86)
11         try_compile(GMX_TARGET_X86 ${CMAKE_BINARY_DIR}
12             "${CMAKE_SOURCE_DIR}/cmake/TestX86.c")
13     endif()
14     if (NOT DEFINED GMX_TARGET_BGQ)
15         try_compile(GMX_TARGET_BGQ ${CMAKE_BINARY_DIR}
16             "${CMAKE_SOURCE_DIR}/cmake/TestBlueGeneQ.c")
17     endif()
18 endfunction()