MantisBT - Open CASCADE
View Issue Details
0029328Open CASCADE[OCCT] OCCT:Configurationpublic2017-11-16 08:562019-07-19 17:11
abv 
apn 
normalminor 
assignedopen 
 
[OCCT] 7.5.0* 
Not needed
0029328: Configuration, CMake scripts - use MATCHES instead of STREQUAL to check for compiler type
Currently in the OCCT's own CMake scripts the checks for compiler type are made using STREQUAL operator. This seems to be not the best practice: both Cotire and OCE do that check using MATCHES operator.
D:\ABV\OCCT\occt\adm\cmake>grep -i clang *

cotire.cmake: # Compiler id for Apple Clang is now AppleClang
cotire.cmake: if (_option_COMPILER_ID MATCHES "Clang")
cotire.cmake: set (_prologue "#pragma clang system_header")
cotire.cmake: elseif (_compilerID MATCHES "Clang")
cotire.cmake: # Clang options used
cotire.cmake: elseif (_compilerID MATCHES "GNU|Clang")
cotire.cmake: # GCC / Clang options used
cotire.cmake: elseif (_compilerID MATCHES "Clang")
cotire.cmake: # Clang options used
cotire.cmake: elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
cotire.cmake: # all Clang versions have PCH support
cotire.cmake: # PCH compilation not supported by GCC / Clang for multi-architecture builds (e.g., i386, x86_64)
cotire.cmake: if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang|Intel|MSVC")
cotire.cmake: elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
cotire.cmake: # Clang looks for a precompiled header corresponding to the prefix header with the extension .pch appended
cotire.cmake: if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
cotire.cmake: # GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
cotire.cmake: if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
cotire.cmake: if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
cotire.cmake: # GNU and Clang require indirect compilation of the prefix header to make them honor the system_header pragma
cotire.cmake: if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
cotire.cmake: C_CLANG_TIDY CXX_CLANG_TIDY)

occt_defs_flags.cmake:elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
occt_defs_flags.cmake:elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
occt_macros.cmake: elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
No tags attached.
Issue History
2017-11-16 08:56abvNew Issue
2017-11-16 08:56abvAssigned To => bugmaster
2017-11-23 14:32bugmasterAssigned Tobugmaster => apn
2017-11-23 14:32bugmasterStatusnew => assigned
2019-07-19 17:11apnTest case number => Not needed
2019-07-19 17:11apnTarget Version => 7.5.0*

There are no notes attached to this issue.