Skip to content

Commit

Permalink
Merge pull request #212 from Davknapp/update_cmake_buildsystem
Browse files Browse the repository at this point in the history
Update cmake buildsystem
  • Loading branch information
cburstedde authored Dec 28, 2024
2 parents 87344cc + 8c6551d commit 60c68f3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
29 changes: 22 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,28 @@ target_include_directories(sc
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(sc PUBLIC
$<$<BOOL:${SC_ENABLE_MPI}>:MPI::MPI_C>
$<$<BOOL:${SC_HAVE_ZLIB}>:ZLIB::ZLIB>
$<$<BOOL:${SC_HAVE_JSON}>:jansson::jansson>
$<$<BOOL:${SC_NEED_M}>:m>
$<$<BOOL:${WIN32}>:${WINSOCK_LIBRARIES}>
)

# optionally link with external libraries
if ( SC_ENABLE_MPI )
target_link_libraries(sc PUBLIC MPI::MPI_C)
endif()

if ( SC_HAVE_ZLIB )
target_link_libraries(sc PUBLIC ZLIB::ZLIB)
endif()


if( SC_HAVE_JSON )
target_link_libraries(sc PUBLIC jansson::jansson)
endif()

if ( SC_NEED_M )
target_link_libraries(sc PUBLIC m)
endif()

if ( WIN32 )
target_link_libraries(sc PUBLIC ${WINSOCK_LIBRARIES})
endif()

# imported target, for use from parent project
add_library(SC::SC INTERFACE IMPORTED GLOBAL)
Expand Down
1 change: 1 addition & 0 deletions doc/author_knapp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I place my contributions to libsc under the FreeBSD license. David Knapp (david.knapp@dlr.de)

0 comments on commit 60c68f3

Please sign in to comment.