2018-12-08 20:10:29 +05:00
|
|
|
|
2019-07-09 21:07:19 +05:00
|
|
|
add_library(ngcore SHARED
|
|
|
|
archive.cpp
|
2019-08-28 17:10:09 +05:00
|
|
|
bitarray.cpp
|
2019-09-23 17:01:35 +05:00
|
|
|
exception.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
localheap.cpp
|
|
|
|
logging.cpp
|
2019-08-06 17:16:13 +05:00
|
|
|
flags.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
paje_trace.cpp
|
|
|
|
profiler.cpp
|
2019-08-29 17:21:18 +05:00
|
|
|
table.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
taskmanager.cpp
|
|
|
|
utils.cpp
|
2020-07-23 22:04:21 +05:00
|
|
|
version.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
)
|
2018-12-28 17:43:15 +05:00
|
|
|
|
2019-08-23 16:26:14 +05:00
|
|
|
# Pybind11 2.3 Issue https://github.com/pybind/pybind11/issues/1604
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|
|
|
target_compile_options(ngcore PUBLIC -fsized-deallocation -faligned-allocation)
|
|
|
|
endif()
|
|
|
|
|
2019-08-06 18:50:08 +05:00
|
|
|
if(USE_PYTHON)
|
|
|
|
target_sources(ngcore PRIVATE python_ngcore.cpp)
|
2019-11-27 00:26:18 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_PYTHON NG_PYTHON)
|
2019-08-06 18:50:08 +05:00
|
|
|
endif(USE_PYTHON)
|
|
|
|
|
2019-08-28 21:41:42 +05:00
|
|
|
if(WIN32)
|
2020-01-17 03:58:56 +05:00
|
|
|
target_compile_options(ngcore PUBLIC /bigobj /MP /W1 /wd4068)
|
|
|
|
get_WIN32_WINNT(ver)
|
|
|
|
target_compile_definitions(ngcore PUBLIC _WIN32_WINNT=${ver} WNT WNT_WINDOW NOMINMAX MSVC_EXPRESS _CRT_SECURE_NO_WARNINGS HAVE_STRUCT_TIMESPEC)
|
|
|
|
target_link_options(ngcore PUBLIC /ignore:4273 /ignore:4217 /ignore:4049)
|
|
|
|
else(WIN32)
|
|
|
|
target_compile_options(ngcore PRIVATE -fvisibility=hidden)
|
2019-08-28 21:41:42 +05:00
|
|
|
endif(WIN32)
|
|
|
|
|
2020-01-17 03:58:56 +05:00
|
|
|
target_compile_definitions(ngcore PRIVATE NGCORE_EXPORTS)
|
2019-10-30 17:56:49 +05:00
|
|
|
target_include_directories(ngcore INTERFACE $<INSTALL_INTERFACE:${NG_INSTALL_DIR_INCLUDE}> $<INSTALL_INTERFACE:${NG_INSTALL_DIR_INCLUDE}/include>)
|
2019-01-02 20:30:55 +05:00
|
|
|
|
2020-01-17 03:58:56 +05:00
|
|
|
if(CHECK_RANGE OR CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
2019-01-02 20:30:55 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_ENABLE_CHECK_RANGE)
|
2020-01-17 03:58:56 +05:00
|
|
|
endif(CHECK_RANGE OR CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
2019-01-02 20:30:55 +05:00
|
|
|
|
2018-12-28 17:43:15 +05:00
|
|
|
if(USE_SPDLOG)
|
|
|
|
include_directories(${SPDLOG_INCLUDE_DIR})
|
|
|
|
install(DIRECTORY ${SPDLOG_INCLUDE_DIR}
|
|
|
|
DESTINATION ${NG_INSTALL_DIR_INCLUDE}
|
|
|
|
)
|
|
|
|
add_dependencies(ngcore project_spdlog)
|
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_USE_SPDLOG)
|
|
|
|
if(DEBUG_LOG)
|
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_LOG_DEBUG)
|
|
|
|
endif(DEBUG_LOG)
|
|
|
|
endif(USE_SPDLOG)
|
2018-11-29 22:35:30 +05:00
|
|
|
|
2020-03-25 14:40:12 +05:00
|
|
|
if(USE_NUMA)
|
|
|
|
find_library(NUMA_LIBRARY libnuma.so)
|
|
|
|
target_compile_definitions(ngcore PUBLIC USE_NUMA)
|
|
|
|
target_link_libraries(ngcore PRIVATE ${NUMA_LIBRARY})
|
|
|
|
endif(USE_NUMA)
|
|
|
|
|
2018-12-03 20:28:04 +05:00
|
|
|
install(TARGETS ngcore DESTINATION ${NG_INSTALL_DIR} COMPONENT netgen)
|
|
|
|
|
2019-11-27 00:26:18 +05:00
|
|
|
target_link_libraries(ngcore PUBLIC netgen_mpi PRIVATE netgen_python ${CMAKE_THREAD_LIBS_INIT})
|
2018-12-21 20:03:44 +05:00
|
|
|
|
2018-12-28 17:43:15 +05:00
|
|
|
install(FILES ngcore.hpp archive.hpp type_traits.hpp version.hpp ngcore_api.hpp logging.hpp
|
2019-02-12 00:01:07 +05:00
|
|
|
exception.hpp symboltable.hpp paje_trace.hpp utils.hpp profiler.hpp mpi_wrapper.hpp
|
2019-08-06 17:16:13 +05:00
|
|
|
array.hpp taskmanager.hpp concurrentqueue.h localheap.hpp python_ngcore.hpp flags.hpp
|
2020-09-19 20:39:03 +05:00
|
|
|
xbool.hpp signal.hpp bitarray.hpp table.hpp hashtable.hpp ranges.hpp
|
2018-12-08 20:10:29 +05:00
|
|
|
DESTINATION ${NG_INSTALL_DIR_INCLUDE}/core COMPONENT netgen_devel)
|
|
|
|
|
|
|
|
if(ENABLE_CPP_CORE_GUIDELINES_CHECK)
|
|
|
|
set_target_properties(ngcore PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}")
|
|
|
|
endif(ENABLE_CPP_CORE_GUIDELINES_CHECK)
|
2018-12-28 17:43:15 +05:00
|
|
|
|
2020-05-18 18:55:40 +05:00
|
|
|
add_dependencies(ngcore ng_generate_version_file)
|
|
|
|
|
2018-12-28 17:43:15 +05:00
|
|
|
if(USE_PYTHON)
|
2019-08-06 18:50:08 +05:00
|
|
|
pybind11_add_module(pyngcore SHARED python_ngcore_export.cpp)
|
2019-11-27 00:26:18 +05:00
|
|
|
target_link_libraries(pyngcore PUBLIC ngcore netgen_python)
|
2018-12-28 17:43:15 +05:00
|
|
|
set_target_properties(pyngcore PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/${NETGEN_PYTHON_RPATH}")
|
|
|
|
install(TARGETS pyngcore DESTINATION ${NG_INSTALL_DIR_PYTHON} COMPONENT netgen)
|
|
|
|
endif(USE_PYTHON)
|
|
|
|
|