Skip to content

Commit a572c0a

Browse files
Merge pull request #361 from nrc-fuels/CMake-windows
CMake on windows (MSVS solutions)
2 parents 07d832c + 4f9784b commit a572c0a

File tree

5 files changed

+155
-6
lines changed

5 files changed

+155
-6
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
cmake_minimum_required ( VERSION 2.8.8 FATAL_ERROR )
1313

14+
# Use MSVS folders to organize projects on windows
15+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
16+
1417
set(PROJECT_DESCRIPTION "A Fortran 2008 JSON API")
1518
set(PROJECT_URL "https://github.com/jacobwilliams/json-fortran")
1619

@@ -239,7 +242,7 @@ if ( ENABLE_TESTS )
239242
enable_testing()
240243

241244
# emulate GNU Autotools `make check`
242-
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
245+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG>)
243246

244247
find_program ( JSONLINT jsonlint )
245248
find_program ( DIFF diff )

cmake/pickFortranCompilerFlags.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,26 @@ if ( NOT Fortran_FLAGS_INIT )
88
"Enable compiler run-time checks? (Enabling this will turn off most compiler optimizations.)" )
99
mark_as_advanced ( ENABLE_RUNTIME_CHECKS )
1010

11+
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" )
12+
set(pre /)
13+
set(spc :)
14+
set(Q /Q)
15+
else()
16+
set(pre -)
17+
set(spc " ")
18+
set(Q -)
19+
endif()
1120
if ( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" )
21+
set(TRACE_FLAG -traceback)
1222
if ( ENABLE_BACK_TRACE )
13-
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -traceback")
23+
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${pre}traceback")
1424
endif ()
1525
if ( ENABLE_COMPILE_TIME_WARNINGS )
1626
# The following warning might be triggered by ifort unless explicitly silenced:
1727
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure
1828
# name. (R1214.4). In the context of F2008 this is an erroneous warning.
1929
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
20-
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn -stand f08 -diag-disable 7601 -diag-disable 5142" )
30+
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${pre}warn ${pre}stand${spc}f08 ${Q}diag-disable${spc}7601 ${Q}diag-disable${spc}5142" )
2131
endif ()
2232
if ( ENABLE_RUNTIME_CHECKS )
2333
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -check all" )

files/expected-outputs/hello-world-ascii.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"hello world": {
3+
"Chinese": "\u4f60\u597d\u4e16\u754c",
4+
"Dutch": "Hello wereld",
5+
"English": "Hello world",
6+
"French": "Bonjour monde",
7+
"German": "Hallo Welt",
8+
"Greek": "\u03b3\u03b5\u03b9\u03ac \u03c3\u03bf\u03c5 \u03ba\u03cc\u03c3\u03bc\u03bf\u03c2",
9+
"Italian": "Ciao mondo",
10+
"Japanese": "\u3053\u3093\u306b\u3061\u306f\u4e16\u754c",
11+
"Korean": "\uc5ec\ubcf4\uc138\uc694 \uc138\uacc4",
12+
"Portuguese": "Ol\u00e1 mundo",
13+
"Russian": "\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u043b\u0442\u0435 \u043c\u0438\u0440",
14+
"Spanish": "Hola mundo",
15+
"Amharic": "\u1235\u120b\u121d \u12a0\u1208\u121d",
16+
"Hebrew": "\u05e9\u05dc\u05d5\u05dd \u05e2\u05d5\u05dc\u05dd",
17+
"Hindi": "\u0939\u0948\u0932\u094b \u0935\u0930\u094d\u0932\u094d\u0921",
18+
"Arabic": "\u0645\u0631\u062d\u0628\u0627 \u0628\u0627\u0644\u0639\u0627\u0644\u0645",
19+
"Urdu": "\u06c1\u06cc\u0644\u0648 \u062f\u0646\u06cc\u0627",
20+
"Thai": "\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e0a\u0e32\u0e27\u0e42\u0e25\u0e01"
21+
},
22+
"UCS4 support?": "\u2713"
23+
}

files/expected-outputs/hello-world-ucs4.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"hello world": {
3+
"Chinese": "你好世界",
4+
"Dutch": "Hello wereld",
5+
"English": "Hello world",
6+
"French": "Bonjour monde",
7+
"German": "Hallo Welt",
8+
"Greek": "γειά σου κόσμος",
9+
"Italian": "Ciao mondo",
10+
"Japanese": "こんにちは世界",
11+
"Korean": "여보세요 세계",
12+
"Portuguese": "Olá mundo",
13+
"Russian": "Здравствулте мир",
14+
"Spanish": "Hola mundo",
15+
"Amharic": "ስላም አለም",
16+
"Hebrew": "שלום עולם",
17+
"Hindi": "हैलो वर्ल्ड",
18+
"Arabic": "مرحبا بالعالم",
19+
"Urdu": "ہیلو دنیا",
20+
"Thai": "สวัสดีชาวโลก"
21+
},
22+
"UCS4 support?": ""
23+
}

files/expected-outputs/test2.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

files/expected-outputs/test2.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"inputs": {
3+
"t0": 0.1E+0,
4+
"tf": 0.11E+1,
5+
"x0": 0.9999E+4,
6+
"integer_scalar": 1,
7+
"integer_array": [
8+
2,
9+
4,
10+
99
11+
],
12+
"names": [
13+
"aaa",
14+
"bbb",
15+
"ccc"
16+
],
17+
"logical_scalar": true,
18+
"logical_vector": [
19+
true,
20+
false,
21+
true
22+
],
23+
"null_variable": null
24+
},
25+
"trajectory": [
26+
{
27+
"VARIABLE": "Rx",
28+
"UNITS": "km",
29+
"FRAME": "J2000",
30+
"CENTER": "EARTH",
31+
"DATA": [
32+
0.1E+1,
33+
0.2E+1,
34+
0.3E+1
35+
]
36+
},
37+
{
38+
"VARIABLE": "Ry",
39+
"UNITS": "km",
40+
"FRAME": "J2000",
41+
"CENTER": "EARTH",
42+
"DATA": [
43+
0.1E+2,
44+
0.2E+2,
45+
0.3E+2
46+
]
47+
},
48+
{
49+
"VARIABLE": "Rz",
50+
"UNITS": "km",
51+
"FRAME": "J2000",
52+
"CENTER": "EARTH",
53+
"DATA": [
54+
0.1E+3,
55+
0.2E+3,
56+
0.3E+3
57+
]
58+
},
59+
{
60+
"VARIABLE": "Vx",
61+
"UNITS": "km\/s",
62+
"FRAME": "J2000",
63+
"CENTER": "EARTH",
64+
"DATA": [
65+
0.1E-2,
66+
0.2E-2,
67+
0.3E-2
68+
]
69+
},
70+
{
71+
"VARIABLE": "Vy",
72+
"UNITS": "km\/s",
73+
"FRAME": "J2000",
74+
"CENTER": "EARTH",
75+
"DATA": [
76+
0.2E-2,
77+
0.2E-1,
78+
0.3E-2
79+
]
80+
},
81+
{
82+
"VARIABLE": "Vz",
83+
"UNITS": "km\/s",
84+
"FRAME": "J2000",
85+
"CENTER": "EARTH",
86+
"DATA": [
87+
0.3E-2,
88+
0.3E-1,
89+
0.4E-1
90+
]
91+
}
92+
]
93+
}

0 commit comments

Comments
 (0)