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
|
|
|
|
2022-04-27 16:42:04 +05:00
|
|
|
target_sources(nglib PRIVATE onetcl.cpp)
|
2015-03-06 18:59:14 +05:00
|
|
|
|
2022-04-27 16:42:04 +05:00
|
|
|
if(USE_GUI)
|
|
|
|
target_sources(nggui PRIVATE
|
2022-05-07 18:13:00 +05:00
|
|
|
gui.cpp ngpkg.cpp demoview.cpp parallelfunc.cpp ngtcl.cpp
|
2017-05-30 00:19:34 +05:00
|
|
|
)
|
|
|
|
|
2021-10-27 19:50:07 +05:00
|
|
|
if(NOT BUILD_FOR_CONDA)
|
2022-04-27 16:42:04 +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)
|
2022-05-05 21:04:18 +05:00
|
|
|
target_link_libraries( netgen nglib nggui netgen_python netgen_gui)
|
2021-10-27 19:50:07 +05:00
|
|
|
install(TARGETS netgen ${NG_INSTALL_DIR})
|
|
|
|
if(APPLE)
|
|
|
|
set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)
|
|
|
|
endif(APPLE)
|
2023-08-29 13:52:22 +05:00
|
|
|
target_link_libraries( netgen ${Python3_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY})
|
2021-10-27 19:50:07 +05:00
|
|
|
endif(NOT BUILD_FOR_CONDA)
|
2017-05-12 16:10:10 +05:00
|
|
|
|
2022-04-27 16:42:04 +05:00
|
|
|
install(TARGETS nggui ${NG_INSTALL_DIR})
|
2015-03-06 18:59:14 +05:00
|
|
|
endif(USE_GUI)
|
|
|
|
|
|
|
|
if(USE_PYTHON)
|
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>" )
|
2024-05-13 16:43:53 +05:00
|
|
|
target_link_libraries( ngpy PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
|
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}")
|
2023-09-16 22:25:43 +05:00
|
|
|
install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
|
2022-04-27 16:42:04 +05:00
|
|
|
|
|
|
|
if(USE_GUI)
|
|
|
|
add_library(ngguipy SHARED ngguipy.cpp)
|
2022-05-05 21:04:18 +05:00
|
|
|
target_link_libraries( ngguipy PUBLIC nglib nggui PRIVATE "$<BUILD_INTERFACE:netgen_python>" $<BUILD_INTERFACE:netgen_gui>)
|
2022-04-27 16:42:04 +05:00
|
|
|
if(APPLE)
|
|
|
|
set_target_properties( ngguipy PROPERTIES SUFFIX ".so")
|
|
|
|
elseif(WIN32)
|
|
|
|
set_target_properties( ngguipy PROPERTIES SUFFIX ".pyd")
|
|
|
|
set_target_properties( ngguipy PROPERTIES OUTPUT_NAME "libngguipy")
|
|
|
|
endif()
|
|
|
|
set_target_properties(ngguipy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
|
2023-09-16 22:25:43 +05:00
|
|
|
install(TARGETS ngguipy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
|
2022-04-27 16:42:04 +05:00
|
|
|
endif(USE_GUI)
|
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)
|
|
|
|
endif(USE_GUI)
|
2015-03-06 18:59:14 +05:00
|
|
|
|