Jonas Hahnfeld | fc473de | 2017-11-30 17:08:31 +0000 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8) |
| 2 | project(DetectTestCompiler C CXX) |
| 3 | |
| 4 | function(write_compiler_information lang) |
| 5 | set(information "${CMAKE_${lang}_COMPILER}") |
| 6 | set(information "${information}\\;${CMAKE_${lang}_COMPILER_ID}") |
| 7 | set(information "${information}\\;${CMAKE_${lang}_COMPILER_VERSION}") |
| 8 | set(information "${information}\\;${OpenMP_${lang}_FLAGS}") |
| 9 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${lang}CompilerInformation.txt ${information}) |
| 10 | endfunction(write_compiler_information) |
| 11 | |
| 12 | find_package(OpenMP) |
| 13 | if (NOT OpenMP_Found) |
| 14 | set(OpenMP_C_FLAGS "-fopenmp") |
| 15 | set(OpenMP_CXX_FLAGS "-fopenmp") |
| 16 | endif() |
| 17 | |
| 18 | write_compiler_information(C) |
| 19 | write_compiler_information(CXX) |