aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-01 19:43:42 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-01 19:44:32 +0100
commit748608275e142428a2f2107d647b3a88c9cf48a0 (patch)
tree8e6296c46fa80d4b83e6fabae5b4861bd916895b /CMakeLists.txt
parent2f011257299cc7d7073b752453dcac254df7a018 (diff)
downloadsysc-playground-748608275e142428a2f2107d647b3a88c9cf48a0.tar.gz
sysc-playground-748608275e142428a2f2107d647b3a88c9cf48a0.zip
cmake: create simulations list instead listing simulation directly in the foreach loop, fix test cmake file
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 16 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f632b41..36103f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,17 +3,26 @@ project(systemc_playground CXX)
set(src ${CMAKE_CURRENT_SOURCE_DIR}/src)
-set (CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME})
+set(CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME})
find_package(SystemCLanguage CONFIG REQUIRED)
# Set CXX std based on SystemC configuration.
-set (CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD} CACHE STRING "C++ standard to build all targets.")
+set(CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD} CACHE STRING "C++ standard to build all targets.")
-foreach (x IN ITEMS event sc_export sc_export2 minimal_socket browse lt_bus)
- add_executable(${x} ${src}/${x}.cc)
- target_include_directories(${x} PRIVATE ${src})
- target_compile_options(${x} PRIVATE -Wall -Wextra)
- target_link_libraries(${x} SystemC::systemc)
+set(simulations
+ event
+ sc_export
+ sc_export2
+ minimal_socket
+ browse
+ lt_bus
+)
+
+foreach(sim IN ITEMS ${simulations})
+ add_executable(${sim} ${src}/${sim}.cc)
+ target_include_directories(${sim} PRIVATE ${src})
+ target_compile_options(${sim} PRIVATE -Wall -Wextra)
+ target_link_libraries(${sim} SystemC::systemc)
endforeach()
# Include tests.