Skip to content

Commit 5cf6821

Browse files
committed
Fix nmake install
1 parent 6064332 commit 5cf6821

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,25 @@ include_directories(BEFORE
362362
${CMAKE_CURRENT_SOURCE_DIR}/include
363363
)
364364

365+
if (MSVC)
366+
# Direct module files to build include directory
367+
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/runtime/flang)
368+
369+
# Install Fortran module files
370+
# TODO: this creates empty directories. Figure out a workaround or
371+
# better would be to figure out why CMAKE_Fortran_MODULE_DIRECTORY is different
372+
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
373+
DESTINATION include FILES_MATCHING PATTERN *.mod
374+
)
375+
else()
365376
# Direct module files to build include directory
366377
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
367378

368379
# Install Fortran module files
369380
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
370381
DESTINATION include
371382
)
383+
endif()
372384

373385
# Install Fortran OpenMP include file
374386
# Copy omp_lib.h file, not the symlink

0 commit comments

Comments
 (0)