Skip to content

Commit 4800e98

Browse files
split smvq into a separate program
1 parent 613a68d commit 4800e98

File tree

4 files changed

+188
-282
lines changed

4 files changed

+188
-282
lines changed

CMakeLists.txt

Lines changed: 1 addition & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -716,189 +716,4 @@ if (smokeview_ini_status_code)
716716
message(FATAL_ERROR "Could not download smokeview.ini ${smokeview_ini_status_code}")
717717
endif()
718718

719-
# parse_smv_benchmark
720-
add_executable(parse_smv_benchmark Tests/parse_smv_benchmark.c
721-
Source/shared/getdata.c
722-
Source/shared/dmalloc.c
723-
Source/smokeview/menus.c
724-
Source/smokeview/IOscript.c
725-
Source/smokeview/IOshooter.c
726-
Source/shared/csphere.c
727-
Source/smokeview/colortimebar.c
728-
Source/smokeview/camera.c
729-
Source/smokeview/IOgeometry.c
730-
Source/smokeview/IOwui.c
731-
Source/smokeview/IOobjects.c
732-
Source/smokeview/IOtour.c
733-
Source/smokeview/getdatacolors.c
734-
Source/smokeview/smokeview.c
735-
Source/smokeview/output.c
736-
Source/smokeview/renderimage.c
737-
Source/smokeview/renderhtml.c
738-
Source/shared/isobox.c
739-
Source/smokeview/getdatabounds.c
740-
Source/smokeview/readsmv.c
741-
Source/smokeview/scontour2d.c
742-
Source/shared/dmalloc.c
743-
Source/shared/compress.c
744-
Source/smokeview/IOvolsmoke.c
745-
Source/smokeview/IOsmoke.c
746-
Source/smokeview/IOplot3d.c
747-
Source/smokeview/IOplot2d.c
748-
Source/smokeview/IOslice.c
749-
Source/smokeview/IOhvac.c
750-
Source/smokeview/IOboundary.c
751-
Source/smokeview/IOpart.c
752-
Source/smokeview/IOzone.c
753-
Source/smokeview/IOiso.c
754-
Source/smokeview/callbacks.c
755-
Source/smokeview/drawGeometry.c
756-
Source/smokeview/skybox.c
757-
Source/shared/file_util.c
758-
Source/shared/string_util.c
759-
Source/smokeview/startup.c
760-
Source/smokeview/shaders.c
761-
Source/smokeview/unit.c
762-
Source/shared/threader.c
763-
Source/shared/histogram.c
764-
Source/shared/translate.c
765-
Source/smokeview/update.c
766-
Source/smokeview/viewports.c
767-
Source/smokeview/smv_geometry.c
768-
Source/smokeview/showscene.c
769-
Source/smokeview/infoheader.c
770-
Source/shared/md5.c
771-
Source/shared/sha1.c
772-
Source/shared/sha256.c
773-
Source/shared/stdio_m.c
774-
Source/shared/stdio_buffer.c
775-
Source/shared/getdata.c
776-
Source/shared/color2rgb.c
777-
Source/smokeview/colortable.c
778-
Source/smokeview/command_args.c
779-
780-
Source/smokeview/glui_smoke.cpp
781-
Source/smokeview/glui_clip.cpp
782-
Source/smokeview/glui_stereo.cpp
783-
Source/smokeview/glui_geometry.cpp
784-
Source/smokeview/glui_motion.cpp
785-
Source/smokeview/glui_bounds.cpp
786-
Source/smokeview/glui_colorbar.cpp
787-
Source/smokeview/glui_display.cpp
788-
Source/smokeview/glui_tour.cpp
789-
Source/smokeview/glui_trainer.cpp
790-
Source/smokeview/glui_objects.cpp
791-
Source/smokeview/glui_shooter.cpp
792-
)
793-
794-
target_include_directories(parse_smv_benchmark PRIVATE
795-
Source/shared
796-
Source/glew
797-
Source/smokeview
798-
Source/glui_v2_1_beta
799-
Source/glui_gl
800-
)
801-
802-
find_package(json-c CONFIG)
803-
if (NOT json-c_FOUND)
804-
if (PKG_CONFIG_FOUND)
805-
pkg_check_modules(json-c json-c)
806-
endif()
807-
if (NOT json-c_FOUND)
808-
FetchContent_Declare(
809-
json-c-git
810-
EXCLUDE_FROM_ALL
811-
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/json-c/json-c
812-
GIT_REPOSITORY https://github.com/json-c/json-c.git
813-
GIT_TAG 33337523f5cff82e659ecbe94b2fac19c7761a42
814-
FIND_PACKAGE_ARGS CONFIG NAMES json-c
815-
)
816-
FetchContent_MakeAvailable(json-c-git)
817-
target_link_libraries(parse_smv_benchmark PRIVATE json-c-static)
818-
target_include_directories(parse_smv_benchmark PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/json-c)
819-
else()
820-
message("${json-c_INCLUDE_DIRS}")
821-
target_link_libraries(parse_smv_benchmark PRIVATE ${json-c_LIBRARIES})
822-
target_include_directories(parse_smv_benchmark PRIVATE ${json-c_INCLUDE_DIRS})
823-
target_compile_options(parse_smv_benchmark PUBLIC ${json-c_CFLAGS_OTHER})
824-
endif()
825-
else()
826-
target_link_libraries(parse_smv_benchmark PRIVATE json-c::json-c)
827-
endif()
828-
829-
# These include directories are an existing workaround that would be good to
830-
# remove.Because of this custom code and the potential conflict with native libs
831-
# this needs to be early in the include order.
832-
if (WIN32)
833-
target_include_directories(parse_smv_benchmark PRIVATE Source/glut_gl)
834-
else()
835-
target_include_directories(parse_smv_benchmark PRIVATE Source/glui_gl)
836-
endif ()
837-
# GLUI can be provided natively, but there are modifications in the code
838-
# vendored with Smokeview that we rely on. Because of this custom code and the
839-
# potential conflict with native libs this needs to be early in the include order.
840-
target_link_libraries(parse_smv_benchmark PRIVATE glui_static)
841-
target_include_directories(parse_smv_benchmark PRIVATE Source/glui_v2_1_beta)
842-
if(WIN32)
843-
if (PThreads4W_FOUND)
844-
target_link_libraries(parse_smv_benchmark PRIVATE PThreads4W::PThreads4W)
845-
else()
846-
target_include_directories(parse_smv_benchmark PRIVATE Source/pthreads)
847-
target_link_libraries(parse_smv_benchmark PRIVATE pthread_static)
848-
endif()
849-
endif()
850-
# Selecting which GLUT version to use is the most platform-dependent part of the
851-
# build.
852-
if (MACOSX)
853-
add_definitions(-Dpp_NOQUARTZ)
854-
target_link_libraries(parse_smv_benchmark PRIVATE "-framework OpenGL" "-framework GLUT")
855-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
856-
elseif (GLUT_FOUND)
857-
target_link_libraries(parse_smv_benchmark PRIVATE GLUT::GLUT)
858-
else()
859-
target_link_libraries(parse_smv_benchmark PRIVATE glut32_static)
860-
endif ()
861-
if (GLEW_FOUND)
862-
target_link_libraries(parse_smv_benchmark PRIVATE GLEW::GLEW)
863-
# This line is a hack to work around the fact the code includes "glew.h"
864-
# rather than <GL/glew.h>
865-
target_include_directories(parse_smv_benchmark PRIVATE ${GLEW_INCLUDE_DIRS}/GL)
866-
else()
867-
target_sources(parse_smv_benchmark PRIVATE
868-
Source/glew/glew.c
869-
)
870-
target_include_directories(parse_smv_benchmark PRIVATE Source/glew)
871-
endif()
872-
if (JPEG_FOUND)
873-
target_link_libraries(parse_smv_benchmark PRIVATE JPEG::JPEG)
874-
else()
875-
target_link_libraries(parse_smv_benchmark PRIVATE jpeg_static)
876-
endif()
877-
if (PNG_FOUND)
878-
target_link_libraries(parse_smv_benchmark PRIVATE PNG::PNG)
879-
else()
880-
target_link_libraries(parse_smv_benchmark PRIVATE png_static)
881-
endif()
882-
if (ZLIB_FOUND)
883-
target_link_libraries(parse_smv_benchmark PRIVATE ZLIB::ZLIB)
884-
else()
885-
target_link_libraries(parse_smv_benchmark PRIVATE zlib_static)
886-
endif()
887-
if (LIBGD_FOUND)
888-
target_link_libraries(parse_smv_benchmark PRIVATE PkgConfig::LIBGD)
889-
else()
890-
target_link_libraries(parse_smv_benchmark PRIVATE gd_static)
891-
endif()
892-
target_link_libraries(parse_smv_benchmark PRIVATE OpenGL::GL OpenGL::GLU)
893-
894-
895-
if (WIN32)
896-
target_include_directories(parse_smv_benchmark PRIVATE Source/pthreads)
897-
endif()
898-
if ((NOT MACOSX) AND UNIX)
899-
target_link_libraries(parse_smv_benchmark PRIVATE m)
900-
endif()
901-
if (LINUX)
902-
add_definitions(-Dpp_LINUX)
903-
target_link_libraries(parse_smv_benchmark PRIVATE pthread X11 Xmu GLU GL m stdc++)
904-
endif()
719+
add_subdirectory(Source/smvq)

Source/smvq/CMakeLists.txt

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
2+
# smvq
3+
add_executable(smvq smvq.c
4+
../shared/getdata.c
5+
../shared/dmalloc.c
6+
../smokeview/menus.c
7+
../smokeview/IOscript.c
8+
../smokeview/IOshooter.c
9+
../shared/csphere.c
10+
../smokeview/colortimebar.c
11+
../smokeview/camera.c
12+
../smokeview/IOgeometry.c
13+
../smokeview/IOwui.c
14+
../smokeview/IOobjects.c
15+
../smokeview/IOtour.c
16+
../smokeview/getdatacolors.c
17+
../smokeview/smokeview.c
18+
../smokeview/output.c
19+
../smokeview/renderimage.c
20+
../smokeview/renderhtml.c
21+
../shared/isobox.c
22+
../smokeview/getdatabounds.c
23+
../smokeview/readsmv.c
24+
../smokeview/scontour2d.c
25+
../shared/dmalloc.c
26+
../shared/compress.c
27+
../smokeview/IOvolsmoke.c
28+
../smokeview/IOsmoke.c
29+
../smokeview/IOplot3d.c
30+
../smokeview/IOplot2d.c
31+
../smokeview/IOslice.c
32+
../smokeview/IOhvac.c
33+
../smokeview/IOboundary.c
34+
../smokeview/IOpart.c
35+
../smokeview/IOzone.c
36+
../smokeview/IOiso.c
37+
../smokeview/callbacks.c
38+
../smokeview/drawGeometry.c
39+
../smokeview/skybox.c
40+
../shared/file_util.c
41+
../shared/string_util.c
42+
../smokeview/startup.c
43+
../smokeview/shaders.c
44+
../smokeview/unit.c
45+
../shared/threader.c
46+
../shared/histogram.c
47+
../shared/translate.c
48+
../smokeview/update.c
49+
../smokeview/viewports.c
50+
../smokeview/smv_geometry.c
51+
../smokeview/showscene.c
52+
../smokeview/infoheader.c
53+
../shared/md5.c
54+
../shared/sha1.c
55+
../shared/sha256.c
56+
../shared/stdio_m.c
57+
../shared/stdio_buffer.c
58+
../shared/getdata.c
59+
../shared/color2rgb.c
60+
../smokeview/colortable.c
61+
../smokeview/command_args.c
62+
63+
../smokeview/glui_smoke.cpp
64+
../smokeview/glui_clip.cpp
65+
../smokeview/glui_stereo.cpp
66+
../smokeview/glui_geometry.cpp
67+
../smokeview/glui_motion.cpp
68+
../smokeview/glui_bounds.cpp
69+
../smokeview/glui_colorbar.cpp
70+
../smokeview/glui_display.cpp
71+
../smokeview/glui_tour.cpp
72+
../smokeview/glui_trainer.cpp
73+
../smokeview/glui_objects.cpp
74+
../smokeview/glui_shooter.cpp
75+
)
76+
77+
target_include_directories(smvq PRIVATE
78+
../shared
79+
../glew
80+
../smokeview
81+
../glui_v2_1_beta
82+
../glui_gl
83+
)
84+
85+
find_package(json-c CONFIG)
86+
if (NOT json-c_FOUND)
87+
if (PKG_CONFIG_FOUND)
88+
pkg_check_modules(json-c json-c)
89+
endif()
90+
if (NOT json-c_FOUND)
91+
FetchContent_Declare(
92+
json-c-git
93+
EXCLUDE_FROM_ALL
94+
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/json-c/json-c
95+
GIT_REPOSITORY https://github.com/json-c/json-c.git
96+
GIT_TAG 33337523f5cff82e659ecbe94b2fac19c7761a42
97+
FIND_PACKAGE_ARGS CONFIG NAMES json-c
98+
)
99+
FetchContent_MakeAvailable(json-c-git)
100+
target_link_libraries(smvq PRIVATE json-c-static)
101+
target_include_directories(smvq PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/json-c)
102+
else()
103+
message("${json-c_INCLUDE_DIRS}")
104+
target_link_libraries(smvq PRIVATE ${json-c_LIBRARIES})
105+
target_include_directories(smvq PRIVATE ${json-c_INCLUDE_DIRS})
106+
target_compile_options(smvq PUBLIC ${json-c_CFLAGS_OTHER})
107+
endif()
108+
else()
109+
target_link_libraries(smvq PRIVATE json-c::json-c)
110+
endif()
111+
112+
# These include directories are an existing workaround that would be good to
113+
# remove.Because of this custom code and the potential conflict with native libs
114+
# this needs to be early in the include order.
115+
if (WIN32)
116+
target_include_directories(smvq PRIVATE ../glut_gl)
117+
else()
118+
target_include_directories(smvq PRIVATE ../glui_gl)
119+
endif ()
120+
# GLUI can be provided natively, but there are modifications in the code
121+
# vendored with Smokeview that we rely on. Because of this custom code and the
122+
# potential conflict with native libs this needs to be early in the include order.
123+
target_link_libraries(smvq PRIVATE glui_static)
124+
target_include_directories(smvq PRIVATE ../glui_v2_1_beta)
125+
if(WIN32)
126+
if (PThreads4W_FOUND)
127+
target_link_libraries(smvq PRIVATE PThreads4W::PThreads4W)
128+
else()
129+
target_include_directories(smvq PRIVATE ../pthreads)
130+
target_link_libraries(smvq PRIVATE pthread_static)
131+
endif()
132+
endif()
133+
# Selecting which GLUT version to use is the most platform-dependent part of the
134+
# build.
135+
if (MACOSX)
136+
add_definitions(-Dpp_NOQUARTZ)
137+
target_link_libraries(smvq PRIVATE "-framework OpenGL" "-framework GLUT")
138+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
139+
elseif (GLUT_FOUND)
140+
target_link_libraries(smvq PRIVATE GLUT::GLUT)
141+
else()
142+
target_link_libraries(smvq PRIVATE glut32_static)
143+
endif ()
144+
if (GLEW_FOUND)
145+
target_link_libraries(smvq PRIVATE GLEW::GLEW)
146+
# This line is a hack to work around the fact the code includes "glew.h"
147+
# rather than <GL/glew.h>
148+
target_include_directories(smvq PRIVATE ${GLEW_INCLUDE_DIRS}/GL)
149+
else()
150+
target_sources(smvq PRIVATE
151+
../glew/glew.c
152+
)
153+
target_include_directories(smvq PRIVATE ../glew)
154+
endif()
155+
if (JPEG_FOUND)
156+
target_link_libraries(smvq PRIVATE JPEG::JPEG)
157+
else()
158+
target_link_libraries(smvq PRIVATE jpeg_static)
159+
endif()
160+
if (PNG_FOUND)
161+
target_link_libraries(smvq PRIVATE PNG::PNG)
162+
else()
163+
target_link_libraries(smvq PRIVATE png_static)
164+
endif()
165+
if (ZLIB_FOUND)
166+
target_link_libraries(smvq PRIVATE ZLIB::ZLIB)
167+
else()
168+
target_link_libraries(smvq PRIVATE zlib_static)
169+
endif()
170+
if (LIBGD_FOUND)
171+
target_link_libraries(smvq PRIVATE PkgConfig::LIBGD)
172+
else()
173+
target_link_libraries(smvq PRIVATE gd_static)
174+
endif()
175+
target_link_libraries(smvq PRIVATE OpenGL::GL OpenGL::GLU)
176+
177+
178+
if (WIN32)
179+
target_include_directories(smvq PRIVATE ../pthreads)
180+
endif()
181+
if ((NOT MACOSX) AND UNIX)
182+
target_link_libraries(smvq PRIVATE m)
183+
endif()
184+
if (LINUX)
185+
add_definitions(-Dpp_LINUX)
186+
target_link_libraries(smvq PRIVATE pthread X11 Xmu GLU GL m stdc++)
187+
endif()
File renamed without changes.

0 commit comments

Comments
 (0)