@@ -291,7 +291,7 @@ if (SMOKEVIEW_OBJECT_DEFS_PATH)
291
291
endif ()
292
292
293
293
if (LUA )
294
- add_definitions ( -Dpp_LUA )
294
+ target_compile_definitions ( smokeview PRIVATE pp_LUA )
295
295
find_package (Lua )
296
296
if (LUA_FOUND )
297
297
target_link_libraries (smokeview PRIVATE ${LUA_LIBRARIES} )
@@ -712,3 +712,164 @@ list(GET smokeview_ini_status 0 smokeview_ini_status_code)
712
712
if (smokeview_ini_status_code )
713
713
message (FATAL_ERROR "Could not download smokeview.ini ${smokeview_ini_status_code} " )
714
714
endif ()
715
+
716
+ # parse_smv_benchmark
717
+ add_executable (parse_smv_benchmark Tests/parse_smv_benchmark.c
718
+ Source /shared/getdata.c
719
+ Source /shared/dmalloc.c
720
+ Source /smokeview/menus.c
721
+ Source /smokeview/IOscript.c
722
+ Source /smokeview/IOshooter.c
723
+ Source /shared/csphere.c
724
+ Source /smokeview/colortimebar.c
725
+ Source /smokeview/camera.c
726
+ Source /smokeview/IOgeometry.c
727
+ Source /smokeview/IOwui.c
728
+ Source /smokeview/IOobjects.c
729
+ Source /smokeview/IOtour.c
730
+ Source /smokeview/getdatacolors.c
731
+ Source /smokeview/smokeview.c
732
+ Source /smokeview/output.c
733
+ Source /smokeview/renderimage.c
734
+ Source /smokeview/renderhtml.c
735
+ Source /shared/isobox.c
736
+ Source /smokeview/getdatabounds.c
737
+ Source /smokeview/readsmv.c
738
+ Source /smokeview/scontour2d.c
739
+ Source /shared/dmalloc.c
740
+ Source /shared/compress.c
741
+ Source /smokeview/IOvolsmoke.c
742
+ Source /smokeview/IOsmoke.c
743
+ Source /smokeview/IOplot3d.c
744
+ Source /smokeview/IOplot2d.c
745
+ Source /smokeview/IOslice.c
746
+ Source /smokeview/IOhvac.c
747
+ Source /smokeview/IOboundary.c
748
+ Source /smokeview/IOpart.c
749
+ Source /smokeview/IOzone.c
750
+ Source /smokeview/IOiso.c
751
+ Source /smokeview/callbacks.c
752
+ Source /smokeview/drawGeometry.c
753
+ Source /smokeview/skybox.c
754
+ Source /shared/file_util.c
755
+ Source /shared/string_util.c
756
+ Source /smokeview/startup.c
757
+ Source /smokeview/shaders.c
758
+ Source /smokeview/unit.c
759
+ Source /smokeview/threader.c
760
+ Source /shared/histogram.c
761
+ Source /shared/translate.c
762
+ Source /smokeview/update.c
763
+ Source /smokeview/viewports.c
764
+ Source /smokeview/smv_geometry.c
765
+ Source /smokeview/showscene.c
766
+ Source /smokeview/infoheader.c
767
+ Source /shared/md5.c
768
+ Source /shared/sha1.c
769
+ Source /shared/sha256.c
770
+ Source /shared/stdio_m.c
771
+ Source /shared/stdio_buffer.c
772
+ Source /shared/getdata.c
773
+ Source /shared/color2rgb.c
774
+ Source /smokeview/colortable.c
775
+ Source /smokeview/command_args.c
776
+
777
+ Source /smokeview/glui_smoke.cpp
778
+ Source /smokeview/glui_clip.cpp
779
+ Source /smokeview/glui_stereo.cpp
780
+ Source /smokeview/glui_geometry.cpp
781
+ Source /smokeview/glui_motion.cpp
782
+ Source /smokeview/glui_bounds.cpp
783
+ Source /smokeview/glui_colorbar.cpp
784
+ Source /smokeview/glui_display.cpp
785
+ Source /smokeview/glui_tour.cpp
786
+ Source /smokeview/glui_trainer.cpp
787
+ Source /smokeview/glui_objects.cpp
788
+ Source /smokeview/glui_shooter.cpp
789
+ )
790
+
791
+ target_include_directories (parse_smv_benchmark PRIVATE
792
+ Source /shared
793
+ Source /glew
794
+ Source /smokeview
795
+ Source /glui_v2_1_beta
796
+ Source /glui_gl
797
+ )
798
+
799
+
800
+ # These include directories are an existing workaround that would be good to
801
+ # remove.Because of this custom code and the potential conflict with native libs
802
+ # this needs to be early in the include order.
803
+ if (WIN32 )
804
+ target_include_directories (parse_smv_benchmark PRIVATE Source /glut_gl )
805
+ else ()
806
+ target_include_directories (parse_smv_benchmark PRIVATE Source /glui_gl )
807
+ endif ()
808
+ # GLUI can be provided natively, but there are modifications in the code
809
+ # vendored with Smokeview that we rely on. Because of this custom code and the
810
+ # potential conflict with native libs this needs to be early in the include order.
811
+ target_link_libraries (parse_smv_benchmark PRIVATE glui_static )
812
+ target_include_directories (parse_smv_benchmark PRIVATE Source /glui_v2_1_beta )
813
+ if (WIN32 )
814
+ if (PThreads4W_FOUND )
815
+ target_link_libraries (parse_smv_benchmark PRIVATE PThreads4W::PThreads4W )
816
+ else ()
817
+ target_include_directories (parse_smv_benchmark PRIVATE Source /pthreads )
818
+ target_link_libraries (parse_smv_benchmark PRIVATE pthread_static )
819
+ endif ()
820
+ endif ()
821
+ # Selecting which GLUT version to use is the most platform-dependent part of the
822
+ # build.
823
+ if (MACOSX )
824
+ add_definitions (-Dpp_NOQUARTZ )
825
+ target_link_libraries (parse_smv_benchmark PRIVATE "-framework OpenGL" "-framework GLUT" )
826
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99" )
827
+ elseif (GLUT_FOUND )
828
+ target_link_libraries (parse_smv_benchmark PRIVATE GLUT::GLUT )
829
+ else ()
830
+ target_link_libraries (parse_smv_benchmark PRIVATE glut32_static )
831
+ endif ()
832
+ if (GLEW_FOUND )
833
+ target_link_libraries (parse_smv_benchmark PRIVATE GLEW::GLEW )
834
+ # This line is a hack to work around the fact the code includes "glew.h"
835
+ # rather than <GL/glew.h>
836
+ target_include_directories (parse_smv_benchmark PRIVATE ${GLEW_INCLUDE_DIRS} /GL )
837
+ else ()
838
+ target_sources (parse_smv_benchmark PRIVATE
839
+ Source /glew/glew.c
840
+ )
841
+ target_include_directories (parse_smv_benchmark PRIVATE Source /glew )
842
+ endif ()
843
+ if (JPEG_FOUND )
844
+ target_link_libraries (parse_smv_benchmark PRIVATE JPEG::JPEG )
845
+ else ()
846
+ target_link_libraries (parse_smv_benchmark PRIVATE jpeg_static )
847
+ endif ()
848
+ if (PNG_FOUND )
849
+ target_link_libraries (parse_smv_benchmark PRIVATE PNG::PNG )
850
+ else ()
851
+ target_link_libraries (parse_smv_benchmark PRIVATE png_static )
852
+ endif ()
853
+ if (ZLIB_FOUND )
854
+ target_link_libraries (parse_smv_benchmark PRIVATE ZLIB::ZLIB )
855
+ else ()
856
+ target_link_libraries (parse_smv_benchmark PRIVATE zlib_static )
857
+ endif ()
858
+ if (LIBGD_FOUND )
859
+ target_link_libraries (parse_smv_benchmark PRIVATE PkgConfig::LIBGD )
860
+ else ()
861
+ target_link_libraries (parse_smv_benchmark PRIVATE gd_static )
862
+ endif ()
863
+ target_link_libraries (parse_smv_benchmark PRIVATE OpenGL::GL OpenGL::GLU )
864
+
865
+
866
+ if (WIN32 )
867
+ target_include_directories (parse_smv_benchmark PRIVATE Source /pthreads )
868
+ endif ()
869
+ if ((NOT MACOSX ) AND UNIX )
870
+ target_link_libraries (parse_smv_benchmark PRIVATE m )
871
+ endif ()
872
+ if (LINUX )
873
+ add_definitions (-Dpp_LINUX )
874
+ target_link_libraries (parse_smv_benchmark PRIVATE pthread X11 Xmu GLU GL m stdc++ )
875
+ endif ()
0 commit comments