Revision: 76221
http://sourceforge.net/p/brlcad/code/76221
Author: starseeker
Date: 2020-06-26 16:28:28 +0000 (Fri, 26 Jun 2020)
Log Message:
-----------
Add backend dependencies for rt targets, but in the process limit the libdm
linkage to those commands that might display graphically.
Modified Paths:
--------------
brlcad/trunk/src/rt/CMakeLists.txt
brlcad/trunk/src/rt/heatgraph.c
brlcad/trunk/src/rt/main.c
Modified: brlcad/trunk/src/rt/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/rt/CMakeLists.txt 2020-06-26 16:01:57 UTC (rev 76220)
+++ brlcad/trunk/src/rt/CMakeLists.txt 2020-06-26 16:28:28 UTC (rev 76221)
@@ -35,7 +35,6 @@
${MPI_C_LIBRARIES}
librt
libnmg
- libdm
liboptical
libicv
${M_LIBRARY}
@@ -45,7 +44,6 @@
${CMAKE_THREAD_LIBS_INIT}
librt
libnmg
- libdm
liboptical
libicv
${M_LIBRARY}
@@ -58,11 +56,14 @@
BRLCAD_ADDEXEC(reshoot "reshoot.c"
"${CMAKE_THREAD_LIBS_INIT};librt;libdm;liboptical;libicv")
-BRLCAD_ADDEXEC(rtshot "rtshot.c" "${RT_STD_LIBS}")
+BRLCAD_ADDEXEC(rtshot "rtshot.c" "${RT_STD_LIBS};libdm")
+ADD_TARGET_DEPS(rtshot dm-ogl dm-wgl)
BRLCAD_ADDEXEC(rtscale "read-rtlog.c;rtscale.c"
"${CMAKE_THREAD_LIBS_INIT};librt;libdm;liboptical;libicv;${M_LIBRARY}")
+ADD_TARGET_DEPS(rtscale dm-ogl dm-wgl)
-BRLCAD_ADDEXEC(rt "${LIBRTUIF_SOURCES};view.c" "${OPENCL_LIBS};${RT_STD_LIBS}")
+BRLCAD_ADDEXEC(rt "${LIBRTUIF_SOURCES};view.c"
"${OPENCL_LIBS};${RT_STD_LIBS};libdm")
+ADD_TARGET_DEPS(rt dm-ogl dm-wgl)
BRLCAD_ADDEXEC(rtarea "${LIBRTUIF_SOURCES};viewarea.c" "${RT_STD_LIBS}")
set_property(TARGET rtarea APPEND PROPERTY COMPILE_DEFINITIONS "RT_TXT_OUTPUT")
@@ -70,7 +71,8 @@
BRLCAD_ADDEXEC(rtcheck "${LIBRTUIF_SOURCES};viewcheck.c" "${RT_STD_LIBS}")
set_property(TARGET rtcheck APPEND PROPERTY COMPILE_DEFINITIONS
"RT_TXT_OUTPUT")
-BRLCAD_ADDEXEC(rtedge "${LIBRTUIF_SOURCES};viewedge.c" "${RT_STD_LIBS}")
+BRLCAD_ADDEXEC(rtedge "${LIBRTUIF_SOURCES};viewedge.c" "${RT_STD_LIBS};libdm")
+ADD_TARGET_DEPS(rtedge dm-ogl dm-wgl)
BRLCAD_ADDEXEC(rtg3 "${LIBRTUIF_SOURCES};viewg3.c" "${RT_STD_LIBS}")
set_property(TARGET rtg3 APPEND PROPERTY COMPILE_DEFINITIONS "RT_TXT_OUTPUT")
@@ -78,12 +80,14 @@
BRLCAD_ADDEXEC(rthide "${LIBRTUIF_SOURCES};viewhide.c" "${RT_STD_LIBS}")
set_property(TARGET rthide APPEND PROPERTY COMPILE_DEFINITIONS "RT_TXT_OUTPUT")
-BRLCAD_ADDEXEC(rtsil "${LIBRTUIF_SOURCES};viewsil.c" "${RT_STD_LIBS}")
+BRLCAD_ADDEXEC(rtsil "${LIBRTUIF_SOURCES};viewsil.c" "${RT_STD_LIBS};libdm")
+ADD_TARGET_DEPS(rtxray dm-ogl dm-wgl)
BRLCAD_ADDEXEC(rtweight "${LIBRTUIF_SOURCES};viewweight.c"
"libanalyze;${RT_STD_LIBS}")
set_property(TARGET rtweight APPEND PROPERTY COMPILE_DEFINITIONS
"RT_TXT_OUTPUT")
-BRLCAD_ADDEXEC(rtxray "${LIBRTUIF_SOURCES};viewxray.c" "${RT_STD_LIBS}")
+BRLCAD_ADDEXEC(rtxray "${LIBRTUIF_SOURCES};viewxray.c" "${RT_STD_LIBS};libdm")
+ADD_TARGET_DEPS(rtxray dm-ogl dm-wgl)
set(rt_ignore_files
CMakeLists.txt
Modified: brlcad/trunk/src/rt/heatgraph.c
===================================================================
--- brlcad/trunk/src/rt/heatgraph.c 2020-06-26 16:01:57 UTC (rev 76220)
+++ brlcad/trunk/src/rt/heatgraph.c 2020-06-26 16:28:28 UTC (rev 76221)
@@ -174,7 +174,7 @@
return timeColor;
}
-
+#ifndef RT_TXT_OUTPUT
/**
* This function takes the contents of the time table, and produces the
* heat graph based on time taken for each pixel.
@@ -263,8 +263,8 @@
(void)fb_view(fbp, width/2, height/2, zoomH, zoomW);
}
}
+#endif
-
/*
* Local Variables:
* mode: C
Modified: brlcad/trunk/src/rt/main.c
===================================================================
--- brlcad/trunk/src/rt/main.c 2020-06-26 16:01:57 UTC (rev 76220)
+++ brlcad/trunk/src/rt/main.c 2020-06-26 16:28:28 UTC (rev 76221)
@@ -141,6 +141,7 @@
n_realloc = bu_n_realloc;
}
+#ifndef RT_TXT_OUTPUT
int fb_setup() {
/* Framebuffer is desired */
size_t xx, yy;
@@ -185,6 +186,7 @@
#endif
return 0;
}
+#endif
int main(int argc, char *argv[])
@@ -524,6 +526,7 @@
if (objv && !matflag) {
int frame_retval;
+#ifndef RT_TXT_OUTPUT
if (need_fb != 0 && !fbp) {
int fb_status = fb_setup();
if (fb_status) {
@@ -533,6 +536,7 @@
return fb_status;
}
}
+#endif
def_tree(rtip); /* Load the default trees */
/* orientation command has not been used */
@@ -540,10 +544,12 @@
do_ae(azimuth, elevation);
frame_retval = do_frame(curframe);
if (frame_retval != 0) {
+#ifndef RT_TXT_OUTPUT
/* Release the framebuffer, if any */
if (fbp != FB_NULL) {
fb_close(fbp);
}
+#endif
ret = 1;
goto rt_cleanup;
}
@@ -577,6 +583,7 @@
* the logic for processing stdin. Postpone fb setup until we're
* ready to render something to avoid backing up stdin's pipe. */
if (!bu_strncmp(buf, "end", 3) || !bu_strncmp(buf, "multiview", 8))
{
+#ifndef RT_TXT_OUTPUT
if (need_fb != 0 && !fbp) {
int fb_status = fb_setup();
if (fb_status) {
@@ -586,6 +593,7 @@
return fb_status;
}
}
+#endif
}
nret = rt_do_cmd( rtip, buf, rt_cmdtab);
@@ -601,9 +609,11 @@
}
/* Release the framebuffer, if any */
+#ifndef RT_TXT_OUTPUT
if (fbp != FB_NULL) {
fb_close(fbp);
}
+#endif
rt_cleanup:
/* Clean up objv memory, if necessary */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits