summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-03-02 16:44:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-03-02 16:44:15 (GMT)
commitfe8fbc6b484236d159325e7af88b699266b52376 (patch)
tree38bfa1d5c7dc6d297fa9d08b08bd174521e9a557 /Modules
parent973eba57f96ae4d6c8d616c706bd194ee261eaed (diff)
parent0110262a2d93da0911f7439ac5fba4e18b29757e (diff)
downloadCMake-fe8fbc6b484236d159325e7af88b699266b52376.zip
CMake-fe8fbc6b484236d159325e7af88b699266b52376.tar.gz
CMake-fe8fbc6b484236d159325e7af88b699266b52376.tar.bz2
Merge topic 'simplify-findopenmp'
0110262 FindOpenMP: simplify check for enabled languages
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindOpenMP.cmake12
1 files changed, 2 insertions, 10 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index e1af15e..b96a2ec 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -25,11 +25,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-get_property(_ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-list(FIND _ENABLED_LANGUAGES "C" _HAVE_LANGUAGE_C)
-list(FIND _ENABLED_LANGUAGES "CXX" _HAVE_LANGUAGE_CXX)
-unset(_ENABLED_LANGUAGES)
-
set(_OPENMP_REQUIRED_VARS)
function(_OPENMP_FLAG_CANDIDATES LANG)
@@ -93,7 +88,7 @@ int main() {
")
# check c compiler
-if(NOT _HAVE_LANGUAGE_C EQUAL -1)
+if(CMAKE_C_COMPILER_LOADED)
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(OpenMP_C_FLAGS)
@@ -124,7 +119,7 @@ if(NOT _HAVE_LANGUAGE_C EQUAL -1)
endif()
# check cxx compiler
-if(NOT _HAVE_LANGUAGE_CXX EQUAL -1)
+if(CMAKE_CXX_COMPILER_LOADED)
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(OpenMP_CXX_FLAGS)
@@ -158,9 +153,6 @@ if(NOT _HAVE_LANGUAGE_CXX EQUAL -1)
unset(OpenMP_CXX_TEST_SOURCE)
endif()
-unset(_HAVE_LANGUAGE_C)
-unset(_HAVE_LANGUAGE_CXX)
-
if(_OPENMP_REQUIRED_VARS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)