From 238bb2f23c74af4d17568a8c1cb95f3b7809ad48 Mon Sep 17 00:00:00 2001 From: Stas Date: Tue, 16 Nov 2021 13:03:15 +0100 Subject: [PATCH] Conan integration in CMake --- .cproject | 20 +++++++++-- .settings/language.settings.xml | 8 ++--- CMakeLists.txt | 61 +++++++++++++++++++++++++++++---- conanfile.txt | 15 -------- scc | 2 +- 5 files changed, 77 insertions(+), 29 deletions(-) delete mode 100644 conanfile.txt diff --git a/.cproject b/.cproject index d31d49e..e2f7de7 100644 --- a/.cproject +++ b/.cproject @@ -19,7 +19,7 @@ - + @@ -273,6 +273,22 @@ true true + + CMAKE_BUILD_TOOL + $<cmake4eclipse_dyn> + all + true + true + true + + + make + + VERBOSE=1 + true + false + true + - + \ No newline at end of file diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 57bac22..40620f1 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/CMakeLists.txt b/CMakeLists.txt index 01d06c6..9a7a315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.12) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) +list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) project(SCC_Test) @@ -16,20 +18,16 @@ get_info_from_git() ### set the directory names of the submodules set(GIT_SUBMODULES scc) set(GIT_SUBMODULE_DIR_sc-components .) -### set each submodules's commit or tag that is to be checked out -### (leave empty if you want master) -#set(GIT_SUBMODULE_VERSION_sc-components 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd) +## set each submodules's commit or tag that is to be checked out +## (leave empty if you want master) set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH}) include(GNUInstallDirs) if(NOT NO_SUBMODULE_CHECK) include(Submodules) endif() -include(Conan) include(BuildType) -#enable_testing() - set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -75,7 +73,56 @@ else() endif() endif() -setup_conan(TARGETS) +########################################################## +## get conan packages +########################################################## +include(ConanInline) + +set(CONAN_BOOST_OPTIONS +boost:fPIC=True +boost:shared=True +boost:header_only=False +boost:without_context=True +boost:without_contract=True +boost:without_coroutine=True +boost:without_fiber=True +boost:without_graph=True +boost:without_graph_parallel=True +boost:without_iostreams=True +boost:without_json=True +boost:without_locale=True +boost:without_log=True +boost:without_math=True +boost:without_mpi=True +boost:without_nowide=True +boost:without_python=True +boost:without_random=True +boost:without_regex=True +boost:without_stacktrace=True +boost:without_test=True +boost:without_timer=True +boost:without_type_erasure=True +boost:without_wave=True +) +set(CONAN_PACKAGE_LIST fmt/6.1.2 boost/1.75.0 gsl-lite/0.37.0) +set(CONAN_PACKAGE_OPTIONS fmt:header_only=True ${CONAN_BOOST_OPTIONS}) +if(NOT DEFINED ENV{SYSTEMC_HOME}) + set(CONAN_PACKAGE_LIST ${CONAN_PACKAGE_LIST} systemc/2.3.3 systemc-cci/1.0.0) + set(CONAN_PACKAGE_OPTIONS ${CONAN_PACKAGE_OPTIONS} systemc-cci:shared=False) +endif() +conan_check() +conan_add_remote(NAME minres URL https://artifactory.minres.com/artifactory/api/conan/oss) +conan_cmake_configure(REQUIRES ${CONAN_PACKAGE_LIST} + GENERATORS cmake_find_package + OPTIONS ${CONAN_PACKAGE_OPTIONS} + ) + +conan_install() +find_package(fmt) +find_package(gsl-lite) +find_package(SystemCLanguage) +find_package(systemc-cci) +######################################################################################## # This line finds the boost lib and headers. set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index 368105a..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,15 +0,0 @@ -[requires] - fmt/6.1.2 - boost/1.75.0 - gsl-lite/0.37.0 - systemc/2.3.3 - #systemc-scv/2.0.1 - systemc-cci/1.0.0 - -[generators] - cmake - -[options] - fmt:header_only=True - systemc:shared=True - systemc-cci:shared=True \ No newline at end of file diff --git a/scc b/scc index 2a11251..6d816e1 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 2a11251ae63f3470245e13f4f576e4c93d2f243c +Subproject commit 6d816e1c9a2adc0e0b74a6473e6ecdb4392de13a