File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,17 @@ set(FLANN_VERSION 1.8.0)
12
12
DISSECT_VERSION ()
13
13
GET_OS_INFO ()
14
14
15
- if ( "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} " MATCHES ".*clang" )
15
+ # CMAKE_C_COMPILER_ID and CMAKE_CXX_COMPILER_ID are documented as internal variables subject to
16
+ # change at: http://www.cmake.org/cmake/help/v2.8.8/cmake.html#variable:CMAKE_LANG_COMPILER_ID
17
+ # however currently this seems the most robust way to detect the presence of the Clang compiler
18
+ if ("${CMAKE_C_COMPILER_ID} " MATCHES "Clang" )
16
19
set (CMAKE_COMPILER_IS_CLANG 1 )
17
20
endif ()
18
21
19
- if ( "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} " MATCHES ".*clang " )
22
+ if ( "${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang " )
20
23
set (CMAKE_COMPILER_IS_CLANGXX 1 )
21
24
endif ()
22
25
23
-
24
26
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake )
25
27
26
28
# Add an "uninstall" target
You can’t perform that action at this time.
0 commit comments