Skip to content

Commit

Permalink
Don't use target_link_directorires (only supported in cmake 3.13+)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Feb 24, 2020
1 parent 48ee3e7 commit c7c3db8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif()
if(dagmc)
find_package(DAGMC REQUIRED)
add_library(dagmc-imported INTERFACE IMPORTED)
target_link_directories(dagmc-imported INTERFACE ${DAGMC_LIBRARY_DIRS})
link_directories(${DAGMC_LIBRARY_DIRS})
target_link_libraries(dagmc-imported INTERFACE ${DAGMC_LIBRARIES})
target_include_directories(dagmc-imported INTERFACE ${DAGMC_INCLUDE_DIRS})
else()
Expand Down
4 changes: 3 additions & 1 deletion cmake/OpenMCConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ find_package(xtensor REQUIRED HINTS ${OpenMC_CMAKE_DIR}/../xtensor)
if(@DAGMC_FOUND@)
find_package(DAGMC REQUIRED HINTS @DAGMC_LIBRARY_DIRS@)
add_library(dagmc-imported INTERFACE IMPORTED)
target_link_directories(dagmc-imported INTERFACE ${DAGMC_LIBRARY_DIRS})
target_link_libraries(dagmc-imported INTERFACE ${DAGMC_LIBRARIES})
foreach(dir ${DAGMC_LIBRARY_DIRS})
target_link_libraries(dagmc-imported INTERFACE "-L${dir}")
endforeach()
target_include_directories(dagmc-imported INTERFACE ${DAGMC_INCLUDE_DIRS})
endif()

Expand Down

0 comments on commit c7c3db8

Please sign in to comment.