File tree Expand file tree Collapse file tree 5 files changed +33
-33
lines changed Expand file tree Collapse file tree 5 files changed +33
-33
lines changed Original file line number Diff line number Diff line change 79
79
set (MULTI_LIB_HEADERS 0 )
80
80
function (compile_option VAR VALUE )
81
81
target_compile_definitions (QuEST PRIVATE ${VAR} =${VALUE} )
82
- set (${VAR} ${VALUE} )
82
+ set (${VAR} ${VALUE} PARENT_SCOPE )
83
83
endfunction ()
84
84
endif ()
85
85
@@ -576,13 +576,18 @@ install(FILES
576
576
DESTINATION "${QuEST_INSTALL_CONFIGDIR} "
577
577
)
578
578
579
- install (FILES "${CMAKE_CURRENT_BINARY_DIR} /include/quest.h"
579
+ install (FILES "${CMAKE_CURRENT_SOURCE_DIR} /quest /include/quest.h"
580
580
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
581
581
)
582
582
583
+ install (FILES "${CMAKE_CURRENT_BINARY_DIR} /include/quest/include/config.h"
584
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /quest/include"
585
+ )
586
+
583
587
install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /quest/include"
584
588
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /quest"
585
589
FILES_MATCHING PATTERN "*.h"
590
+ PATTERN "quest.h" EXCLUDE
586
591
)
587
592
588
593
install (EXPORT QuESTTargets
Original file line number Diff line number Diff line change 2
2
# @author Erich Essmann
3
3
# @author Luc Jaulmes (using config file)
4
4
5
- configure_file (quest .h.in "${CMAKE_BINARY_DIR} /include/quest.h" @ONLY )
5
+ configure_file (config .h.in "${CMAKE_BINARY_DIR} /include/quest/include/config .h" @ONLY )
Original file line number Diff line number Diff line change
1
+ #ifndef CONFIG_H
2
+ #define CONFIG_H
3
+
4
+ // be warned, the below is sensitive to whitespace after the slash
5
+ #if !defined(FLOAT_PRECISION )\
6
+ || !defined(COMPILE_MPI )\
7
+ || !defined(COMPILE_OPENMP )\
8
+ || !defined(COMPILE_CUDA )\
9
+ || !defined(COMPILE_CUQUANTUM )
10
+
11
+ // bind compile settings to installed exec
12
+ #if !@MULTI_LIB_HEADERS @
13
+ #cmakedefine FLOAT_PRECISION @FLOAT_PRECISION@
14
+ #cmakedefine01 COMPILE_MPI
15
+ #cmakedefine01 COMPILE_OPENMP
16
+ #cmakedefine01 COMPILE_CUDA
17
+ #cmakedefine01 COMPILE_CUQUANTUM
18
+ #endif
19
+
20
+ #endif
21
+
22
+ #endif
Original file line number Diff line number Diff line change 15
15
16
16
17
17
18
- // ensure all mode flags are defined
19
-
20
- #ifndef COMPILE_MPI
21
- #error "Compiler must define COMPILE_MPI"
22
- #endif
23
-
24
- #ifndef COMPILE_OPENMP
25
- #error "Compiler must define COMPILE_OPENMP"
26
- #endif
27
-
28
- #ifndef COMPILE_CUDA
29
- #error "Compiler must define COMPILE_CUDA"
30
- #endif
31
-
32
- #ifndef COMPILE_CUQUANTUM
33
- #error "Compiler must define COMPILE_CUQUANTUM"
34
- #endif
35
-
36
-
37
-
38
18
// ensure all mode flags are valid values
19
+ // undefined allowed as undefined == 0 in C/C++ standards
39
20
40
21
#if ! (COMPILE_MPI == 0 || COMPILE_MPI == 1)
41
22
#error "Macro COMPILE_MPI must have value 0 or 1"
Original file line number Diff line number Diff line change 31
31
#define QUEST_H
32
32
33
33
34
- // bind compile settings to installed exec
35
- #if !@MULTI_LIB_HEADERS @
36
- #cmakedefine FLOAT_PRECISION @FLOAT_PRECISION@
37
- #cmakedefine01 COMPILE_MPI
38
- #cmakedefine01 COMPILE_OPENMP
39
- #cmakedefine01 COMPILE_CUDA
40
- #cmakedefine01 COMPILE_CUQUANTUM
41
- #endif
42
-
43
-
44
34
// include version first so it is accessible to
45
35
// debuggers in case a subsequent include fails
46
36
#include "quest/include/version.h"
47
37
38
+ #include "quest/include/config.h"
39
+
48
40
// include before API headers since it validates
49
41
// preprocessor configuration, and affirms macro
50
42
// preconditions assumed by subsequent header
You can’t perform that action at this time.
0 commit comments