Skip to content

Commit

Permalink
Check if SystemC target is defined
Browse files Browse the repository at this point in the history
If add_subdirectory() is used for SystemC then we don't have to
search for it again as the target is already defined.

Signed-off-by: Lukas Jünger <[email protected]>
  • Loading branch information
aut0 committed Mar 6, 2024
1 parent 83079ee commit 704054c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ endif (NOT SystemC_TARGET_ARCH)

list (APPEND CMAKE_PREFIX_PATH /opt/systemc)

IF (NOT SystemCLanguage_FOUND )
IF (NOT SystemCLanguage_FOUND AND NOT TARGET SystemC::systemc)
find_package(SystemCLanguage CONFIG REQUIRED)
ENDIF ()
message (STATUS "Using SystemC ${SystemCLanguage_VERSION} (${SystemCLanguage_DIR})")
Expand Down Expand Up @@ -567,6 +567,3 @@ install(FILES "${PROJECT_BINARY_DIR}/SystemCCCIConfig.cmake"
"${PROJECT_BINARY_DIR}/SystemCCCIConfigVersion.cmake"
DESTINATION "${SystemCCCI_INSTALL_CMAKEDIR}"
COMPONENT dev)



2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ add_library (cci
# it's not found. As the user is using SystemC, the cmake files should
# be available.
set (CMAKE_PREFIX_PATH /opt/systemc)
if ( NOT SystemCLanguage_FOUND )
if ( NOT SystemCLanguage_FOUND AND NOT TARGET SystemC::systemc )
find_package(SystemCLanguage CONFIG REQUIRED)
ENDIF ()

Expand Down

0 comments on commit 704054c

Please sign in to comment.