2017-10-26 11:41:35 +02:00
|
|
|
cmake_minimum_required(VERSION 3.3)
|
2017-10-04 15:58:28 +02:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake)
|
|
|
|
|
|
|
|
include(cmake/GitFunctions.cmake)
|
|
|
|
get_branch_from_git()
|
2017-08-27 12:10:38 +02:00
|
|
|
|
|
|
|
### set the directory names of the submodules
|
2017-10-04 15:58:28 +02:00
|
|
|
set(GIT_SUBMODULES elfio libGIS sc-components dbt-core)
|
2017-08-27 12:10:38 +02:00
|
|
|
set(GIT_SUBMODULE_DIR_sc-components .)
|
|
|
|
set(GIT_SUBMODULE_DIR_dbt-core .)
|
|
|
|
### set each submodules's commit or tag that is to be checked out
|
|
|
|
### (leave empty if you want master)
|
|
|
|
#set(GIT_SUBMODULE_VERSION_sc-comp 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd)
|
2017-10-04 15:58:28 +02:00
|
|
|
set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH})
|
|
|
|
set(GIT_SUBMODULE_BRANCH_dbt-core ${GIT_BRANCH})
|
2017-08-27 12:10:38 +02:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
2017-10-04 23:15:04 +02:00
|
|
|
include(Submodules)
|
2017-10-26 11:41:35 +02:00
|
|
|
include(Conan)
|
2017-08-27 12:10:38 +02:00
|
|
|
|
|
|
|
#enable_testing()
|
|
|
|
|
2017-10-26 11:41:35 +02:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2017-08-27 12:10:38 +02:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
set(warnings "-Wall -Wextra -Werror")
|
2017-10-26 11:41:35 +02:00
|
|
|
set(CMAKE_CXX_FLAG_RELEASE "-O3 -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=0")
|
2017-09-25 20:38:40 +02:00
|
|
|
set(CMAKE_C_FLAG_RELEASE "-O3 -DNDEBUG")
|
2017-10-26 11:41:35 +02:00
|
|
|
set(CMAKE_CXX_FLAG_DEBUG "-Og -D_GLIBCXX_USE_CXX11_ABI=0")
|
2017-08-27 12:10:38 +02:00
|
|
|
set(CMAKE_C_FLAG_DEBUG "-Og")
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
set(warnings "/W4 /WX /EHsc")
|
|
|
|
endif()
|
|
|
|
|
2017-10-26 11:41:35 +02:00
|
|
|
setup_conan()
|
|
|
|
|
2017-10-04 15:58:28 +02:00
|
|
|
find_package(Threads)
|
|
|
|
find_package(Tcmalloc)
|
2017-08-27 12:10:38 +02:00
|
|
|
|
2017-09-22 11:23:23 +02:00
|
|
|
set(PROJECT_3PARTY_DIRS external sr_report sr_signal)
|
2017-10-04 23:15:04 +02:00
|
|
|
include(clang-format)
|
2017-09-22 11:23:23 +02:00
|
|
|
|
2017-08-27 12:10:38 +02:00
|
|
|
add_subdirectory(external)
|
|
|
|
add_subdirectory(dbt-core)
|
|
|
|
add_subdirectory(sc-components)
|
|
|
|
add_subdirectory(riscv)
|
2017-09-21 20:29:23 +02:00
|
|
|
add_subdirectory(riscv.sc)
|
2017-10-26 11:41:35 +02:00
|
|
|
|
|
|
|
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
|