|
|
|
|
@@ -1,9 +1,9 @@
|
|
|
|
|
cmake_minimum_required(VERSION 3.3)
|
|
|
|
|
cmake_minimum_required(VERSION 3.12)
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake)
|
|
|
|
|
|
|
|
|
|
project(pysysc-sc)
|
|
|
|
|
|
|
|
|
|
set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries")
|
|
|
|
|
option(INSTALL_DEPENDENCIES "Should dependencies be installed when installing SCC" OFF)
|
|
|
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
include(BuildType)
|
|
|
|
|
@@ -32,8 +32,25 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
|
set(warnings "/W4 /WX /EHsc")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
|
|
include(ConanInline)
|
|
|
|
|
conan_check()
|
|
|
|
|
if(EXISTS /etc/redhat-release)
|
|
|
|
|
# Boost on CentOS quirks: the b2 of conan-center is build against a newer libstdc++ and therefore does not run
|
|
|
|
|
# with the oooooold libs on CentOS 7. Therefore we build our own version of b2 if it is not there
|
|
|
|
|
set(B2_VERSION 4.9.2)
|
|
|
|
|
set(B2_META $ENV{HOME}/.conan/data/b2/${B2_VERSION}/_/_/metadata.json)
|
|
|
|
|
if(DEFINED ENV{CONAN_USER_HOME})
|
|
|
|
|
set(B2_META $ENV{CONAN_USER_HOME}/.conan/data/b2/${B2_VERSION}/_/_/metadata.json)
|
|
|
|
|
endif()
|
|
|
|
|
if(NOT EXISTS ${B2_META})
|
|
|
|
|
conan_configure(REQUIRES b2/${B2_VERSION})
|
|
|
|
|
conan_cmake_autodetect(settings)
|
|
|
|
|
conan_cmake_install(PATH_OR_REFERENCE . BUILD b2 SETTINGS ${settings})
|
|
|
|
|
endif()
|
|
|
|
|
# Boost on CentOS quirks end
|
|
|
|
|
endif()
|
|
|
|
|
set(BOOST_OPTIONS
|
|
|
|
|
boost:fPIC=True
|
|
|
|
|
boost:shared=True
|
|
|
|
|
@@ -62,26 +79,36 @@ boost:without_type_erasure=True
|
|
|
|
|
boost:without_wave=True
|
|
|
|
|
)
|
|
|
|
|
set(CONAN_PACKAGE_LIST fmt/8.0.1 spdlog/1.9.2 zlib/1.2.11 boost/1.75.0 yaml-cpp/0.7.0 jsoncpp/1.9.5 lz4/1.9.3)
|
|
|
|
|
if(BUILD_SCC_DOCUMENTATION)
|
|
|
|
|
list(APPEND CONAN_PACKAGE_LIST doxygen/1.9.2)
|
|
|
|
|
endif()
|
|
|
|
|
set(CONAN_PACKAGE_OPTIONS fmt:header_only=True spdlog:header_only=True ${BOOST_OPTIONS})
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
|
list(APPEND CONAN_PACKAGE_OPTIONS boost:fPIC=True)
|
|
|
|
|
endif()
|
|
|
|
|
if(NOT USE_CWR_SYSTEMC AND NOT USE_NCSC_SYSTEMC AND NOT DEFINED ENV{SYSTEMC_HOME})
|
|
|
|
|
set(CONAN_PACKAGE_LIST ${CONAN_PACKAGE_LIST} systemc/2.3.4)
|
|
|
|
|
set(CONAN_PACKAGE_OPTIONS ${CONAN_PACKAGE_OPTIONS} systemc:shared=True)
|
|
|
|
|
endif()
|
|
|
|
|
conan_configure(REQUIRES ${CONAN_PACKAGE_LIST}
|
|
|
|
|
GENERATORS cmake_find_package
|
|
|
|
|
OPTIONS ${CONAN_PACKAGE_OPTIONS}
|
|
|
|
|
)
|
|
|
|
|
conan_install()
|
|
|
|
|
|
|
|
|
|
conan_configure(REQUIRES ${CONAN_PACKAGE_LIST} GENERATORS cmake_find_package OPTIONS ${CONAN_PACKAGE_OPTIONS})
|
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
|
|
|
conan_install(BUILD_TYPE Release)
|
|
|
|
|
else()
|
|
|
|
|
conan_install()
|
|
|
|
|
endif()
|
|
|
|
|
set(CONAN_CMAKE_SILENT_OUTPUT ON)
|
|
|
|
|
|
|
|
|
|
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
|
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
find_package(Boost COMPONENTS program_options system thread REQUIRED)
|
|
|
|
|
|
|
|
|
|
include(SystemCPackage)
|
|
|
|
|
find_package(spdlog REQUIRED)
|
|
|
|
|
find_package(lz4 REQUIRED)
|
|
|
|
|
find_package(fmt REQUIRED)
|
|
|
|
|
find_package(yaml-cpp REQUIRED)
|
|
|
|
|
find_package(lz4 REQUIRED)
|
|
|
|
|
include(SystemCPackage)
|
|
|
|
|
|
|
|
|
|
add_subdirectory(scc)
|
|
|
|
|
add_subdirectory(vp_components)
|
|
|
|
|
|