Skip to content

Commit

Permalink
Export MmgTargets only when building at least one library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Algiane committed Feb 26, 2020
1 parent 9ddbd33 commit 29a9288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,13 @@ IF( USE_SCOTCH )
INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS})
ENDIF()

install(EXPORT MmgTargets
FILE MmgTargets.cmake
NAMESPACE Mmg::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mmg
)
IF ( MmgTargetsExported )
install(EXPORT MmgTargets
FILE MmgTargets.cmake
NAMESPACE Mmg::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mmg
)
ENDIF()

###############################################################################
#####
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ MACRO ( ADD_AND_INSTALL_LIBRARY
# )


SET ( MmgTargetsExported 1 )
install(TARGETS ${target_name} EXPORT MmgTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down

0 comments on commit 29a9288

Please sign in to comment.