@@ -17,55 +17,61 @@ include(cmake/PreventInSourceBuilds.cmake)
17
17
include (cmake/CheckSubmodule.cmake)
18
18
include (cmake/PackageAddTest.cmake)
19
19
20
- # Use the warnings specified in CompilerWarnings.cmake
21
- add_library (project_warnings INTERFACE )
20
+ if (NOT TARGET project_warnings)
21
+ # Use the warnings specified in CompilerWarnings.cmake
22
+ add_library (project_warnings INTERFACE )
22
23
23
- # Standard compiler warnings
24
- include (cmake/CompilerWarnings.cmake)
25
- set_project_warnings(project_warnings)
24
+ # Standard compiler warnings
25
+ include (cmake/CompilerWarnings.cmake)
26
+ set_project_warnings(project_warnings)
27
+ endif ()
26
28
27
- # Interface library to set project options
28
- add_library (project_options INTERFACE )
29
+ if (NOT TARGET project_options)
30
+ # Use the options specified in CompilerOptions.cmake
31
+ add_library (project_options INTERFACE )
29
32
30
- # Compiler options
31
- include (cmake/CompilerOptions.cmake)
32
- enable_project_options(project_options)
33
+ # Standard compiler options
34
+ include (cmake/CompilerOptions.cmake)
35
+ enable_project_options(project_options)
33
36
34
- # Sanitizer options if supported by compiler
35
- include (cmake/Sanitizers.cmake)
36
- enable_sanitizers(project_options)
37
+ # Sanitizer options if supported by compiler
38
+ include (cmake/Sanitizers.cmake)
39
+ enable_sanitizers(project_options)
40
+ endif ()
37
41
38
42
# add main library code
39
- add_library (
40
- ${PROJECT_NAME}
41
- INTERFACE
42
- include /dd/Complex.hpp
43
- include /dd/ComplexCache.hpp
44
- include /dd/ComplexNumbers.hpp
45
- include /dd/ComplexTable.hpp
46
- include /dd/ComplexValue.hpp
47
- include /dd/ComputeTable.hpp
48
- include /dd/Control.hpp
49
- include /dd/Definitions .hpp
50
- include /dd/Edge.hpp
51
- include /dd/Export.hpp
52
- include /dd/GateMatrixDefinitions.hpp
53
- include /dd/Node.hpp
54
- include /dd/Package.hpp
55
- include /dd/ToffoliTable.hpp
56
- include /dd/UnaryComputeTable.hpp
57
- include /dd/DensityNoiseTable.hpp
58
- include /dd/StochasticNoiseOperationTable.hpp
59
- include /dd/UniqueTable.hpp)
43
+ if (NOT TARGET ${PROJECT_NAME} )
44
+ add_library (
45
+ ${PROJECT_NAME}
46
+ INTERFACE
47
+ include /dd/Complex.hpp
48
+ include /dd/ComplexCache.hpp
49
+ include /dd/ComplexNumbers.hpp
50
+ include /dd/ComplexTable.hpp
51
+ include /dd/ComplexValue.hpp
52
+ include /dd/ComputeTable.hpp
53
+ include /dd/Control.hpp
54
+ include /dd/Definitions .hpp
55
+ include /dd/Edge.hpp
56
+ include /dd/Export.hpp
57
+ include /dd/GateMatrixDefinitions.hpp
58
+ include /dd/Node.hpp
59
+ include /dd/Package.hpp
60
+ include /dd/ToffoliTable.hpp
61
+ include /dd/UnaryComputeTable.hpp
62
+ include /dd/DensityNoiseTable.hpp
63
+ include /dd/StochasticNoiseOperationTable.hpp
64
+ include /dd/UniqueTable.hpp)
60
65
61
- # add options and warnings to library
62
- target_link_libraries (${PROJECT_NAME} INTERFACE project_options project_warnings)
66
+ # add options and warnings to library
67
+ target_link_libraries (${PROJECT_NAME} INTERFACE project_options project_warnings)
63
68
64
- # set include directories
65
- target_include_directories (${PROJECT_NAME} INTERFACE include ${PROJECT_BINARY_DIR} /include )
69
+ # set include directories
70
+ target_include_directories (${PROJECT_NAME} INTERFACE include ${PROJECT_BINARY_DIR} /include )
66
71
67
- # add MQT alias
68
- add_library (MQT::DDPackage ALIAS ${PROJECT_NAME} )
72
+ # add MQT alias
73
+ add_library (MQT::DDPackage ALIAS ${PROJECT_NAME} )
74
+ endif ()
69
75
70
76
# add test code
71
77
option (BUILD_DD_PACKAGE_TESTS "Also build tests for DD package" )
0 commit comments