mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
[cmake] Replace object libraries with interface libraries
This commit is contained in:
parent
99c95757a3
commit
247b2a2892
@ -1,13 +1,13 @@
|
||||
add_definitions(-DNGINTERFACE_EXPORTS)
|
||||
add_library(gen OBJECT
|
||||
array.cpp bitarray.cpp dynamicmem.cpp flags.cpp
|
||||
hashtabl.cpp mystring.cpp optmem.cpp parthreads.cpp
|
||||
seti.cpp sort.cpp spbita2d.cpp table.cpp
|
||||
mpi_interface.cpp gzstream.cpp
|
||||
add_library(gen INTERFACE)
|
||||
set(sdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_sources(gen INTERFACE
|
||||
${sdir}/array.cpp ${sdir}/bitarray.cpp ${sdir}/dynamicmem.cpp ${sdir}/flags.cpp
|
||||
${sdir}/hashtabl.cpp ${sdir}/mystring.cpp ${sdir}/optmem.cpp ${sdir}/parthreads.cpp
|
||||
${sdir}/seti.cpp ${sdir}/sort.cpp ${sdir}/spbita2d.cpp ${sdir}/table.cpp
|
||||
${sdir}/mpi_interface.cpp ${sdir}/gzstream.cpp
|
||||
)
|
||||
|
||||
set_target_properties( gen PROPERTIES POSITION_INDEPENDENT_CODE ON )
|
||||
|
||||
install(FILES
|
||||
array.hpp autodiff.hpp autoptr.hpp bitarray.hpp
|
||||
dynamicmem.hpp flags.hpp hashtabl.hpp mpi_interface.hpp myadt.hpp
|
||||
|
@ -1,11 +1,11 @@
|
||||
add_definitions(-DNGINTERFACE_EXPORTS)
|
||||
add_library(gprim OBJECT
|
||||
adtree.cpp geom2d.cpp geom3d.cpp geomfuncs.cpp
|
||||
geomtest3d.cpp transform3d.cpp spline.cpp splinegeometry.cpp
|
||||
add_library(gprim INTERFACE)
|
||||
set(sdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_sources(gprim INTERFACE
|
||||
${sdir}/adtree.cpp ${sdir}/geom2d.cpp ${sdir}/geom3d.cpp ${sdir}/geomfuncs.cpp
|
||||
${sdir}/geomtest3d.cpp ${sdir}/transform3d.cpp ${sdir}/spline.cpp ${sdir}/splinegeometry.cpp
|
||||
)
|
||||
|
||||
set_target_properties( gprim PROPERTIES POSITION_INDEPENDENT_CODE ON )
|
||||
|
||||
install(FILES
|
||||
adtree.hpp geom2d.hpp geom3d.hpp geomfuncs.hpp geomobjects2.hpp
|
||||
geomobjects.hpp geomops2.hpp geomops.hpp geomtest3d.hpp gprim.hpp
|
||||
|
@ -1,8 +1,8 @@
|
||||
add_library( la OBJECT
|
||||
densemat.cpp polynomial.cpp bfgs.cpp linopt.cpp linsearch.cpp
|
||||
)
|
||||
|
||||
set_target_properties(la PROPERTIES POSITION_INDEPENDENT_CODE ON )
|
||||
add_library( la INTERFACE )
|
||||
set(sdir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_sources( la INTERFACE
|
||||
${sdir}/densemat.cpp ${sdir}/polynomial.cpp ${sdir}/bfgs.cpp ${sdir}/linopt.cpp ${sdir}/linsearch.cpp
|
||||
)
|
||||
|
||||
install(FILES
|
||||
densemat.hpp linalg.hpp opti.hpp
|
||||
|
@ -1,12 +1,4 @@
|
||||
add_definitions(-DNGINTERFACE_EXPORTS)
|
||||
if(NOT WIN32)
|
||||
set(mesh_object_libs
|
||||
$<TARGET_OBJECTS:la>
|
||||
$<TARGET_OBJECTS:gprim>
|
||||
$<TARGET_OBJECTS:gen>
|
||||
)
|
||||
endif(NOT WIN32)
|
||||
|
||||
add_library(mesh ${NG_LIB_TYPE}
|
||||
adfront2.cpp adfront3.cpp bisect.cpp boundarylayer.cpp
|
||||
clusters.cpp curvedelems.cpp delaunay.cpp delaunay2d.cpp
|
||||
@ -29,8 +21,10 @@ if(APPLE)
|
||||
set_target_properties( mesh PROPERTIES SUFFIX ".so")
|
||||
endif(APPLE)
|
||||
|
||||
target_link_libraries( mesh PUBLIC ngcore PRIVATE gprim la gen )
|
||||
|
||||
if(NOT WIN32)
|
||||
target_link_libraries( mesh ngcore ${ZLIB_LIBRARIES} ${MPI_CXX_LIBRARIES} ${PYTHON_LIBRARIES} ${METIS_LIBRARY})
|
||||
target_link_libraries( mesh PUBLIC ${ZLIB_LIBRARIES} ${MPI_CXX_LIBRARIES} ${PYTHON_LIBRARIES} ${METIS_LIBRARY})
|
||||
install( TARGETS mesh ${NG_INSTALL_DIR})
|
||||
endif(NOT WIN32)
|
||||
|
||||
|
@ -8,9 +8,6 @@ if(WIN32)
|
||||
$<TARGET_OBJECTS:geom2d>
|
||||
$<TARGET_OBJECTS:csg>
|
||||
$<TARGET_OBJECTS:stl>
|
||||
$<TARGET_OBJECTS:gen>
|
||||
$<TARGET_OBJECTS:la>
|
||||
$<TARGET_OBJECTS:gprim>
|
||||
|
||||
$<TARGET_OBJECTS:visual>
|
||||
$<TARGET_OBJECTS:occ>
|
||||
@ -32,7 +29,7 @@ if(NOT WIN32)
|
||||
endif(USE_GUI)
|
||||
endif(NOT WIN32)
|
||||
|
||||
target_link_libraries(nglib PUBLIC ngcore)
|
||||
target_link_libraries(nglib PRIVATE gen la gprim PUBLIC ngcore)
|
||||
|
||||
target_link_libraries( nglib PRIVATE ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user