clean-up of build system

This commit is contained in:
2020-04-23 16:11:34 +02:00
parent 7f096a7d87
commit 19d76c2948
5 changed files with 15 additions and 90 deletions

View File

@ -1,39 +1,7 @@
cmake_minimum_required(VERSION 3.3)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
project (sc-components)
# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "0")
set(VERSION_PATCH "1")
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
include(Common)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Threads)
find_package(OSCISystemC REQUIRED)
find_package(ZLIB)
if(SystemC_FOUND)
include_directories(${SystemC_INCLUDE_DIRS})
link_directories(${SystemC_LIBRARY_DIRS}
)
else()
message( FATAL_ERROR "SystemC library not found." )
endif()
if(ZLIB_FOUND)
include_directories( ${ZLIB_INCLUDE_DIRS} )
endif(ZLIB_FOUND)
cmake_minimum_required(VERSION 3.12)
if(SCV_FOUND)
add_definitions(-DWITH_SCV)
include_directories(${SCV_INCLUDE_DIRS})
link_directories(${SCV_LIBRARY_DIRS})
add_subdirectory(transaction_recording)
endif(SCV_FOUND)
endif()
add_subdirectory(simple_system)

View File

@ -1,6 +1,4 @@
cmake_minimum_required(VERSION 3.3)
# Add executable called "simple_system" that is built from the source files
# "scv_tr_recording_example.cpp". The extensions are automatically found.
cmake_minimum_required(VERSION 3.12)
add_executable (simple_system
plic.cpp
uart.cpp
@ -10,14 +8,5 @@ add_executable (simple_system
simple_system.cpp
sc_main.cpp
)
# Link the executable to the sc_components library. Since the sc_components library has
# public include directories we will use those link directories when building
# simple_system
target_link_libraries (simple_system LINK_PUBLIC scc)
#target_link_libraries (simple_system LINK_PUBLIC ${SystemC_LIBRARIES})
#target_link_libraries (simple_system LINK_PUBLIC ${SCV_LIBRARIES})
target_link_libraries (simple_system LINK_PUBLIC ${Boost_LIBRARIES} )
#target_link_libraries (simple_system LINK_PUBLIC ${CONAN_LIBS_LEVELDB})
#target_link_libraries (simple_system LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT})
#target_link_libraries (simple_system LINK_PUBLIC ${ZLIB_LIBRARY})
#target_link_libraries (simple_system LINK_PUBLIC ${CMAKE_DL_LIBS})

View File

@ -1,15 +1,5 @@
cmake_minimum_required(VERSION 3.3)
# Add executable called "transaction_recording" that is built from the source files
# "scv_tr_recording_example.cpp". The extensions are automatically found.
cmake_minimum_required(VERSION 3.12)
add_executable (transaction_recording
scv_tr_recording_example.cpp
)
# Link the executable to the sc_components library. Since the sc_components library has
# public include directories we will use those link directories when building
# transaction_recording
target_link_libraries (transaction_recording LINK_PUBLIC scc)
#target_link_libraries (transaction_recording LINK_PUBLIC ${Boost_LIBRARIES} )
#target_link_libraries (transaction_recording LINK_PUBLIC ${CONAN_LIBS_LEVELDB})
#target_link_libraries (transaction_recording LINK_PUBLIC ${ZLIB_LIBRARIES} )
#target_link_libraries (transaction_recording LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT})
#target_link_libraries (transaction_recording LINK_PUBLIC ${CMAKE_DL_LIBS})