2017-05-30 00:19:34 +05:00
|
|
|
if(USE_INTERNAL_TCL)
|
|
|
|
add_definitions(-DINTERNAL_TCL_DEFAULT=1)
|
|
|
|
else()
|
|
|
|
add_definitions(-DINTERNAL_TCL_DEFAULT=0)
|
|
|
|
endif()
|
2017-05-10 22:34:42 +05:00
|
|
|
|
2017-05-30 00:19:34 +05:00
|
|
|
if(WIN32)
|
2020-11-16 20:10:46 +05:00
|
|
|
# add icon and version info to netgen executable
|
|
|
|
enable_language(RC)
|
|
|
|
# Don't use ccache here due to incompatibility with the resource compiler
|
|
|
|
set_directory_properties(PROPERTIES RULE_LAUNCH_COMPILE "")
|
2017-05-30 00:19:34 +05:00
|
|
|
endif(WIN32)
|
2015-03-06 18:59:14 +05:00
|
|
|
|
|
|
|
if(USE_GUI)
|
|
|
|
|
2017-05-30 00:19:34 +05:00
|
|
|
add_library(gui SHARED
|
2021-10-11 19:04:00 +05:00
|
|
|
gui.cpp ngpkg.cpp demoview.cpp parallelfunc.cpp ngtcl.cpp
|
2017-05-30 00:19:34 +05:00
|
|
|
../libsrc/stlgeom/stlpkg.cpp ../libsrc/visualization/visualpkg.cpp
|
|
|
|
../libsrc/csg/csgpkg.cpp ../libsrc/geom2d/geom2dpkg.cpp
|
|
|
|
../libsrc/occ/occpkg.cpp ../libsrc/occ/vsocc.cpp
|
|
|
|
)
|
|
|
|
|
2020-03-02 21:29:35 +05:00
|
|
|
add_executable(netgen ngappinit.cpp)
|
2020-11-16 20:10:46 +05:00
|
|
|
if(WIN32)
|
|
|
|
target_sources(netgen PRIVATE ../windows/netgen.rc)
|
|
|
|
endif(WIN32)
|
2017-05-10 22:34:42 +05:00
|
|
|
|
2018-11-13 15:22:37 +05:00
|
|
|
target_link_libraries( gui PUBLIC nglib )
|
2018-11-23 14:52:27 +05:00
|
|
|
target_link_libraries( gui PRIVATE ${LIBTOGL} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} )
|
2018-11-20 19:09:48 +05:00
|
|
|
if(NOT APPLE)
|
|
|
|
target_link_libraries( gui PRIVATE ${TCL_LIBRARY} ${TK_LIBRARY})
|
|
|
|
endif(NOT APPLE)
|
2017-05-10 22:34:42 +05:00
|
|
|
|
2019-11-27 00:26:18 +05:00
|
|
|
target_link_libraries( netgen nglib gui netgen_python ${MPI_mpi_LIBRARY} ${MPI_CXX_LIBRARIES} ${LIBTOGL} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY})
|
2017-05-12 16:10:10 +05:00
|
|
|
|
2015-10-19 13:08:30 +05:00
|
|
|
if(NOT WIN32)
|
|
|
|
target_link_libraries( netgen mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )
|
2017-05-10 22:34:42 +05:00
|
|
|
target_link_libraries( gui PUBLIC mesh stlvis stl geom2dvis interface geom2d csg stl visual csgvis )
|
2015-10-19 13:08:30 +05:00
|
|
|
endif(NOT WIN32)
|
2015-03-06 18:59:14 +05:00
|
|
|
|
2017-05-30 00:19:34 +05:00
|
|
|
install(TARGETS netgen ${NG_INSTALL_DIR})
|
|
|
|
install(TARGETS gui ${NG_INSTALL_DIR})
|
2017-05-08 19:42:49 +05:00
|
|
|
|
2016-02-08 19:53:16 +05:00
|
|
|
if(APPLE)
|
2016-02-23 17:08:09 +05:00
|
|
|
set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)
|
2016-02-08 19:53:16 +05:00
|
|
|
endif(APPLE)
|
2017-05-10 22:34:42 +05:00
|
|
|
if(WIN32)
|
|
|
|
set_target_properties( gui PROPERTIES OUTPUT_NAME libgui )
|
|
|
|
endif(WIN32)
|
2020-12-18 15:05:10 +05:00
|
|
|
target_link_libraries( gui PRIVATE "$<BUILD_INTERFACE:netgen_python>" )
|
2015-03-06 18:59:14 +05:00
|
|
|
|
|
|
|
endif(USE_GUI)
|
|
|
|
|
|
|
|
if(USE_PYTHON)
|
2019-11-27 18:03:20 +05:00
|
|
|
if(USE_GUI)
|
|
|
|
if(${BUILD_FOR_CONDA} AND UNIX AND NOT APPLE)
|
|
|
|
target_link_libraries( netgen -Wl,--no-as-needed ${PYTHON_LIBRARIES})
|
|
|
|
elseif()
|
|
|
|
target_link_libraries( netgen ${PYTHON_LIBRARIES})
|
|
|
|
endif()
|
2019-11-27 00:26:18 +05:00
|
|
|
endif()
|
|
|
|
|
2015-10-20 14:09:29 +05:00
|
|
|
add_library(ngpy SHARED netgenpy.cpp)
|
2020-12-18 15:05:10 +05:00
|
|
|
target_link_libraries( ngpy PUBLIC nglib PRIVATE "$<BUILD_INTERFACE:netgen_python>" )
|
2015-03-06 18:59:14 +05:00
|
|
|
if(APPLE)
|
2015-10-20 14:09:29 +05:00
|
|
|
set_target_properties( ngpy PROPERTIES SUFFIX ".so")
|
2015-03-06 18:59:14 +05:00
|
|
|
elseif(WIN32)
|
2015-10-20 14:09:29 +05:00
|
|
|
set_target_properties( ngpy PROPERTIES SUFFIX ".pyd")
|
2015-10-20 14:15:01 +05:00
|
|
|
set_target_properties( ngpy PROPERTIES OUTPUT_NAME "libngpy")
|
2015-03-06 18:59:14 +05:00
|
|
|
endif()
|
2017-05-30 00:19:34 +05:00
|
|
|
set_target_properties(ngpy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
|
2017-06-08 19:49:17 +05:00
|
|
|
install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen)
|
2015-03-06 18:59:14 +05:00
|
|
|
endif(USE_PYTHON)
|
|
|
|
|
2017-01-31 19:35:56 +05:00
|
|
|
if(USE_GUI)
|
2017-05-30 00:19:34 +05:00
|
|
|
if(NOT USE_INTERNAL_TCL)
|
|
|
|
install(FILES
|
|
|
|
dialog.tcl menustat.tcl ngicon.tcl ng.tcl
|
|
|
|
ngvisual.tcl sockets.tcl nghelp.tcl ngshell.tcl
|
|
|
|
ngtesting.tcl parameters.tcl variables.tcl csgeom.tcl stlgeom.tcl
|
|
|
|
occgeom.tcl acisgeom.tcl netgen.ocf drawing.tcl
|
|
|
|
DESTINATION ${NG_INSTALL_DIR_BIN} COMPONENT netgen)
|
|
|
|
endif()
|
2017-01-31 19:35:56 +05:00
|
|
|
|
|
|
|
add_subdirectory(Togl2.1)
|
2021-10-11 19:04:00 +05:00
|
|
|
install(FILES
|
|
|
|
ngtcl.hpp
|
|
|
|
DESTINATION ${NG_INSTALL_DIR_INCLUDE} COMPONENT netgen_devel
|
|
|
|
)
|
2017-01-31 19:35:56 +05:00
|
|
|
endif(USE_GUI)
|
2015-03-06 18:59:14 +05:00
|
|
|
|