Skip to content

Commit

Permalink
Move 'libm' target to packages where it is used
Browse files Browse the repository at this point in the history
Keep the top-level CMakeLists.txt cleaner, and keep the imported
libraries where they are used to make the packages more separable.

User Support Ticket(s) or Story Referenced: TRILFRAME-601
  • Loading branch information
sebrowne committed Oct 5, 2023
1 parent 8c972a7 commit 81f6955
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ SET(Trilinos_MUST_FIND_ALL_TPL_LIBS_DEFAULT TRUE)

SET(CMAKE_LINK_LIBRARIES_ONLY_TARGETS ON)

add_library(toolchain::m INTERFACE IMPORTED)
set_property(TARGET toolchain::m PROPERTY IMPORTED_LIBNAME "m")

# Set up C++ language standard selection
include(SetTrilinosCxxStandard)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ ENDIF()
# LibM not available under MSVC.
IF(NOT MSVC)
# Add libm linking for ceil, floor and such.
LIST(APPEND IMPORTEDLIBS toolchain::m)
add_library(SuiteSparse::m INTERFACE IMPORTED)
set_property(TARGET SuiteSparse::m PROPERTY IMPORTED_LIBNAME "m")
LIST(APPEND IMPORTEDLIBS SuiteSparse::m)
ENDIF()

TRIBITS_ADD_LIBRARY(
Expand Down
4 changes: 3 additions & 1 deletion packages/zoltan/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,9 @@ ENDIF()

IF(NOT MSVC)
# Add libm linking for ceil, floor and such.
LIST(APPEND IMPORTEDLIBS toolchain::m)
add_library(Zoltan::m INTERFACE IMPORTED)
set_property(TARGET Zoltan::m PROPERTY IMPORTED_LIBNAME "m")
LIST(APPEND IMPORTEDLIBS Zoltan::m)
ENDIF()

TRIBITS_ADD_LIBRARY(
Expand Down

0 comments on commit 81f6955

Please sign in to comment.