From c513abc45b8776d80457fa97db9cef14630e627f Mon Sep 17 00:00:00 2001 From: iasonmanolas Date: Fri, 28 Jan 2022 19:59:42 +0200 Subject: [PATCH] Added dlib to dependencies since I move the reducedmodeloptimizer to MySources. Refacoting --- CMakeLists.txt | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1452db..79dc24f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,24 @@ if(NOT EXISTS ${EXTERNAL_DEPS_DIR}) endif() ##Create directory for the external libraries file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR}) + +#dlib +set(DLIB_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/dlib) +download_project(PROJ DLIB + GIT_REPOSITORY https://github.com/davisking/dlib.git + GIT_TAG master + BINARY_DIR ${DLIB_BIN_DIR} + PREFIX ${EXTERNAL_DEPS_DIR} + ${UPDATE_DISCONNECTED_IF_AVAILABLE} +) +add_subdirectory(${DLIB_SOURCE_DIR} ${DLIB_BIN_DIR}) +if(${MYSOURCES_STATIC_LINK}) + target_link_libraries(${PROJECT_NAME} PUBLIC -static dlib::dlib) +else() + target_link_libraries(${PROJECT_NAME} PUBLIC dlib::dlib) +endif() +add_compile_definitions(DLIB_DEFINED) + if(${USE_POLYSCOPE}) set(POLYSCOPE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/polyscope) download_project(PROJ POLYSCOPE @@ -56,7 +74,8 @@ add_subdirectory(${MATPLOTPLUSPLUS_SOURCE_DIR} ${MATPLOTPLUSPLUS_BINARY_DIR}) ##threed-beam-fea set(threed-beam-fea_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/threed-beam-fea) download_project(PROJ threed-beam-fea - GIT_REPOSITORY https://github.com/IasonManolas/threed-beam-fea.git +# GIT_REPOSITORY https://github.com/IasonManolas/threed-beam-fea.git + GIT_REPOSITORY https://gitea-s2i2s.isti.cnr.it/manolas/threed-beam-fea.git GIT_TAG master BINARY_DIR ${threed-beam-fea_BINARY_DIR} PREFIX ${EXTERNAL_DEPS_DIR} @@ -76,6 +95,7 @@ download_project(PROJ TBB option(TBB_BUILD_TESTS "Build TBB tests and enable testing infrastructure" OFF) add_subdirectory(${TBB_SOURCE_DIR} ${TBB_BINARY_DIR}) link_directories(${TBB_BINARY_DIR}) + ###Eigen 3 NOTE: Eigen is required on the system the code is ran find_package(Eigen3 3.3 REQUIRED) if(MSVC) @@ -85,7 +105,7 @@ endif(MSVC) if(${MYSOURCES_STATIC_LINK}) message("Linking statically") - target_link_libraries(${PROJECT_NAME} PUBLIC -static Eigen3::Eigen matplot ThreedBeamFEA ${TBB_BINARY_DIR}/libtbb_static.a #[[tbb_static]] pthread gfortran quadmath) + target_link_libraries(${PROJECT_NAME} PUBLIC -static Eigen3::Eigen matplot ThreedBeamFEA tbb_static pthread gfortran quadmath) else() # set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen matplot ThreedBeamFEA tbb pthread) @@ -98,8 +118,7 @@ target_link_directories(MySources PUBLIC ${CMAKE_CURRENT_LIST_DIR}/boost_graph/l target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/boost_graph PUBLIC ${vcglib_devel_SOURCE_DIR} -# PUBLIC ${threed-beam-fea_SOURCE_DIR} - PUBLIC ThreedBeamFEA + PUBLIC ${threed-beam-fea_SOURCE_DIR} PUBLIC matplot ) @@ -117,7 +136,7 @@ if(USE_ENSMALLEN) set(ARMADILLO_SOURCE_DIR "/home/iason/Coding/Libraries/armadillo") add_subdirectory(${ARMADILLO_SOURCE_DIR} ${EXTERNAL_DEPS_DIR}/armadillo_build) if(${MYSOURCES_STATIC_LINK}) - target_link_libraries(${PROJECT_NAME} PUBLIC "-static" ensmallen ${EXTERNAL_DEPS_DIR}/armadillo_build/libarmadillo.a) + target_link_libraries(${PROJECT_NAME} PUBLIC "-static" ensmallen armadillo) else() target_link_libraries(${PROJECT_NAME} PUBLIC armadillo ensmallen) endif()