Skip to content

Commit

Permalink
cmake: fix cmakelists.txt for map
Browse files Browse the repository at this point in the history
The _Types.f90 were collected in the wrong library.  This was causing cmake + Visual studio to fail in building (VS treated the mapcpplib build as cpp only and ignored the .f90 files)
  • Loading branch information
andrew-platt committed Apr 12, 2023
1 parent 8a03232 commit f2a3bc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif()
file(GLOB MAP_CLIB_SOURCES src/*.c src/*.cc src/*/*.c src/*/*.cc)
file(GLOB MAP_C_HEADERS src/*.h src/*/*.h)

add_library(mapcpplib_obj OBJECT ${MAP_CLIB_SOURCES} src/MAP_Types.f90 src/MAP_Fortran_Types.f90)
add_library(mapcpplib_obj OBJECT ${MAP_CLIB_SOURCES})

target_include_directories(mapcpplib_obj PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/bstring>
Expand All @@ -52,7 +52,7 @@ set(MAP_F_SOURCES
src/MAP_Fortran_Types.f90
)

add_library(maplib_obj OBJECT src/map.f90)
add_library(maplib_obj OBJECT ${MAP_F_SOURCES})
target_link_libraries(maplib_obj mapcpplib_obj nwtclibs_obj)

add_library(maplib $<TARGET_OBJECTS:mapcpplib_obj> $<TARGET_OBJECTS:maplib_obj>)
Expand Down

0 comments on commit f2a3bc2

Please sign in to comment.