Browse Source

Fixes to allow re-use

Eyck Jentzsch 7 months ago
parent
commit
e552b4b3ca
2 changed files with 20 additions and 1 deletions
  1. 20
    0
      cmake/Common.cmake
  2. 0
    1
      incl/scc/utilities.h

+ 20
- 0
cmake/Common.cmake View File

@@ -0,0 +1,20 @@
1
+# Function to link between sub-projects
2
+function(add_dependent_subproject subproject_name)
3
+	#if (NOT TARGET ${subproject_name}) # target unknown
4
+    if(NOT PROJECT_${subproject_name}) # var unknown because we build only this subproject
5
+        find_package(${subproject_name} CONFIG REQUIRED)
6
+    else () # we know the target thus we are doing a build from the top directory
7
+        include_directories(../${subproject_name}/incl)
8
+    endif ()
9
+endfunction(add_dependent_subproject)
10
+
11
+    # Make sure we tell the topdir CMakeLists that we exist (if build from topdir)
12
+get_directory_property(hasParent PARENT_DIRECTORY)
13
+if(hasParent)
14
+    set(PROJECT_${PROJECT_NAME} true PARENT_SCOPE)
15
+endif()
16
+
17
+# Function to link between sub-projects
18
+function(add_dependent_header subproject_name)
19
+    include_directories(../${subproject_name}/incl)
20
+endfunction(add_dependent_header)

+ 0
- 1
incl/scc/utilities.h View File

@@ -23,7 +23,6 @@
23 23
 #ifndef _SYSC_UTILITIES_H_
24 24
 #define _SYSC_UTILITIES_H_
25 25
 
26
-#include "traceable.h"
27 26
 #include <memory>
28 27
 
29 28
 // pragmas to disable the deprecated warnings for SystemC headers