diff --git a/CMakeLists.txt b/CMakeLists.txt index 87663e5510b2275eef30fc90046a53a02f2b4bfa..1831c8d28b9ae44d401683e70192d4da21fe1dce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,18 +7,7 @@ else() ADD_DEFINITIONS("-DBOOST_TEST_DYN_LINK") endif() -#cmake_policy(SET CMP0074 NEW) -#cmake_policy(SET CMP0060 NEW) - -#if(WIN32) -# message("Setting no library prefixes...") -# set(CMAKE_STATIC_LIBRARY_PREFIX "") -# set(CMAKE_SHARED_LIBRARY_PREFIX "") -# set(CMAKE_SHARED_MODULE_PREFIX "") -# set(CMAKE_IMPORT_LIBRARY_PREFIX "") -# set(PREFIX "") -# set(IMPORT_PREFIX "") -#endif() + #-------------------------------# # Default installation location # @@ -36,6 +25,13 @@ if (NOT CMAKE_BUILD_TYPE) FORCE) endif (NOT CMAKE_BUILD_TYPE) +#------------------------# +# Dependencies link type # +#------------------------# +if(NOT DEPENDENCIES_LINK_TYPE AND NOT ENV{DEPENDENCIES_LINK_TYPE}) + message(FATAL_ERROR "Please, set the variable DEPENDENCIES_LINK_TYPE to either 'static' or 'shared'!") +endif() + #--------------------------------# # Setting C++ compiler flags # #--------------------------------# @@ -60,17 +56,16 @@ message("Looking for external libraries...") set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(Boost_USE_MULTITHREADED ON) +set(BOOST_INCLUDEDIR "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost") +set(BOOST_LIBRARYDIR "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost/stage/lib") find_package( Boost - + COMPONENTS system serialization random - - HINTS - external_dependencies/boost ) message("Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}") @@ -79,12 +74,7 @@ message("lib4neuro LIB DIR: ${LIB4NEURO_DIR}") message("sadf ${Boost_LIBRARIES}") -find_package( - exprtk - - HINTS - external_dependencies/exprtk -) +find_package(exprtk) #------------------------------------------# # Detect maximum available number of cores # diff --git a/build.sh b/build.sh index 414ccae2779715ac69c0761edc2e9b821679e420..cf78459333c4084d32605ca6f30adf5760fa44ac 100755 --- a/build.sh +++ b/build.sh @@ -16,8 +16,8 @@ DEPENDENCIES_LINK_TYPE=shared # shared/static BUILD_TYPE=Debug # C++ compiler -CXX_COMPILER=g++-8 -C_COMPILER=gcc-8 +CXX_COMPILER=g++ +C_COMPILER=gcc if [ -z "$BUILD_TYPE" ] || [ -z "$CXX_COMPILER" ]; then (>&2 echo "Set, please, both BUILD_TYPE and CXX_COMPILER variables in the 'build.sh' script.") diff --git a/build_scripts/linux/clean_dependencies.sh b/build_scripts/linux/clean_dependencies.sh new file mode 100755 index 0000000000000000000000000000000000000000..3b4ead63bb41002d099ab633e7c62349c5ee8cb7 --- /dev/null +++ b/build_scripts/linux/clean_dependencies.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +rm ../../external_dependencies/boost/* +rm ../../external_dependencies/exprtk/* diff --git a/build_scripts/linux/linux_gcc_build_x64_debug_local.sh b/build_scripts/linux/linux_gcc_build_x64_debug_local.sh index 211208ad8ed35d82c7060a78666ae78b1f73da01..7af32a96e1023cf369809daad0ea1d36e2a213b9 100755 --- a/build_scripts/linux/linux_gcc_build_x64_debug_local.sh +++ b/build_scripts/linux/linux_gcc_build_x64_debug_local.sh @@ -58,6 +58,7 @@ fi if [ $REBUILD_BOOST = "yes" ] then echo "The required '${CYAN}BOOST${NC}' library will be recompiled in the directory '${YELLOW}external_dependencies/boost${NC}'" + rm -rf ../../external_dependencies/boost/stage/lib/* BUILD_SOMETHING=yes BUILD_SOMETHING_LIB=yes fi diff --git a/external_dependencies/boost b/external_dependencies/boost index 693f99029b0c59fd151d0db56a7bcf02ffc68ea3..7142eb200291e29c11a448c58c2c1031664aa69b 160000 --- a/external_dependencies/boost +++ b/external_dependencies/boost @@ -1 +1 @@ -Subproject commit 693f99029b0c59fd151d0db56a7bcf02ffc68ea3 +Subproject commit 7142eb200291e29c11a448c58c2c1031664aa69b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f7a555b0f3ff2cceaff94ade34bcf277e2bc2af6..e101619e25d58a7b6d778cad4bbdf5bc4bc8b981 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,21 +23,12 @@ if ("${BUILD_LIB}" STREQUAL "yes") Solvers/DESolver.cpp ) - if("${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared") - target_link_libraries( - lib4neuro - - PUBLIC - ${Boost_LIBRARIES} - ) - else() - target_link_libraries( - lib4neuro + target_link_libraries( + lib4neuro - PRIVATE - ${Boost_LIBRARIES} - ) - endif() + PRIVATE + ${Boost_LIBRARIES} + ) target_include_directories( lib4neuro