diff --git a/CMakeLists.txt b/CMakeLists.txt index a3f13d17..3d4e3483 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,22 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON) find_package (Threads REQUIRED) +# Henson +if (NOT DEFINED HENSON AND DEFINED ENV{HENSON}) + set (HENSON $ENV{HENSON}) +endif () + +if (HENSON) + set (HENSON_LIBRARY ${HENSON}/lib/libhenson.a) + set (HENSON_PMPI_LIBRARY ${HENSON}/lib/libhenson-pmpi.so) +else () + message ("Looking for Henson") + find_package (henson REQUIRED) +endif () +message ("HENSON_LIBRARY = ${HENSON_LIBRARY}") +message ("HENSON_PMPI_LIBRARY = ${HENSON_PMPI_LIBRARY}") +set (libraries ${libraries} ${HENSON_PMPI_LIBRARY} ${HENSON_LIBRARY}) + if (FTK_USE_CGAL STREQUAL AUTO) find_package (CGAL QUIET) elseif (FTK_USE_CGAL) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e34fb5a4..48ee681b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,10 @@ +if (NOT APPLE) + set (linker_flags "-pie -Wl,--export-dynamic") + set (linker_flags "${linker_flags} -Wl,-u,henson_set_contexts,-u,henson_set_namemap") +else () + set (linker_flags "-Wl,-u,_henson_set_contexts,-u,_henson_set_namemap") +endif (NOT APPLE) + if (FTK_BUILD_PYFTK) include_directories (${PYTHON_INCLUDE_DIRS}) endif () @@ -45,6 +52,12 @@ endif () add_library (libftk SHARED ${ftk_sources} ${ftk_cuda_sources} ${ftk_sycl_sources}) target_link_libraries (libftk ndarray::ndarray ${CMAKE_THREAD_LIBS_INIT}) +add_library (ftk_shared SHARED cli/ftk.cpp) +target_link_libraries (ftk_shared PRIVATE libftk ${libraries}) +set_target_properties (ftk_shared PROPERTIES PREFIX "") +set_target_properties (ftk_shared PROPERTIES SUFFIX ".so") +set_target_properties (ftk_shared PROPERTIES LINK_FLAGS ${linker_flags}) + if (FTK_HAVE_ADIOS1) target_link_libraries (libftk ${ADIOS_LIBRARIES}) endif () @@ -133,6 +146,13 @@ install (TARGETS libftk ftk # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +install (TARGETS ftk_shared + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_WRITE GROUP_EXECUTE + WORLD_READ WORLD_WRITE WORLD_EXECUTE +) + install (EXPORT FTKTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/FTK NAMESPACE FTK::)