# Empty FindOpenMP variables

**URL:** https://discourse.cmake.org/t/empty-findopenmp-variables/3449
**Category:** Code
**Created:** [May 31, 2021, 9:03pm UTC](https://discourse.cmake.org/t/empty-findopenmp-variables/3449 "2021-05-31T21:03:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gzauhar](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/7c8e57/32.png) [@gzauhar](https://discourse.cmake.org/u/gzauhar)
#### Post date: [May 31, 2021, 9:03pm UTC](https://discourse.cmake.org/t/empty-findopenmp-variables/3449/1 "2021-05-31T21:03:01Z")

</div>

Hi there!  
I have weird problem with CMake/IntelFortran/OpenMP setup. Following code snippet works as intended on Linux with Intel Fortran 2020. Code compiles, runs and produces correct result.

On Windows with Intel Fortran 2020 (and Visual Studio 2017) code also compiles, runs and produces correct result but variables **OpenMP\_Fortran\_LIBRARIES** and **OpenMP\_Fortran\_LIB\_NAMES** are empty! I invoke cmake-gui from Intel Fortran x64 command line environment and use Ninja.

```
cmake_minimum_required(VERSION 3.19)
project(omp_test Fortran)

find_package(OpenMP)
if (NOT OpenMP_Fortran_FOUND)
    message(FATAL_ERROR "OpenMP not found")
endif ()

message(STATUS "-------> ${OpenMP_Fortran_LIB_NAMES}")
message(STATUS "-------> ${OpenMP_Fortran_LIBRARIES}")
message(STATUS "-------> ${OpenMP_Fortran_FLAGS}")
message(STATUS "-------> ${OpenMP_Fortran_VERSION}")

file(WRITE test.f90 "program omp_test\nuse omp_lib\nprint *, omp_get_max_threads()\nend program omp_test")
add_executable(omp_test test.f90)
target_link_libraries(omp_test OpenMP::OpenMP_Fortran)

```

What am I doing wrong?  
Thank you in advance.  
/Goran
