Revision: 75867
          http://sourceforge.net/p/brlcad/code/75867
Author:   starseeker
Date:     2020-05-21 14:09:11 +0000 (Thu, 21 May 2020)
Log Message:
-----------
See if we can push MSVC specific library setting up into one location.

Modified Paths:
--------------
    brlcad/branches/bioh/CMakeLists.txt
    brlcad/branches/bioh/src/CMakeLists.txt
    brlcad/branches/bioh/src/adrt/CMakeLists.txt
    brlcad/branches/bioh/src/archer/CMakeLists.txt
    brlcad/branches/bioh/src/brlman/CMakeLists.txt
    brlcad/branches/bioh/src/bwish/CMakeLists.txt
    brlcad/branches/bioh/src/conv/iges/CMakeLists.txt
    brlcad/branches/bioh/src/libfb/CMakeLists.txt
    brlcad/branches/bioh/src/mged/CMakeLists.txt

Modified: brlcad/branches/bioh/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/CMakeLists.txt 2020-05-21 14:05:20 UTC (rev 75866)
+++ brlcad/branches/bioh/CMakeLists.txt 2020-05-21 14:09:11 UTC (rev 75867)
@@ -114,16 +114,6 @@
 include(CMakeDependentOption)
 
 #---------------------------------------------------------------------
-# Check whether we need to add import/export lines to libraries
-if(MSVC)
-  # TODO - this was a cheat, and now that we're looking at hiding
-  # symbols on other platforms it's not really going to work.  We
-  # will be transitioning to using HIDE_INTERNAL_SYMBOLS instead
-  # of this, which means we eventually will need to stop using it
-  # to hide platform specific bits behind.
-  set(CPP_DLL_DEFINES 1)
-endif(MSVC)
-
 # Define an option to use OBJECT libraries - when we build this
 # way, we also need position independent code.
 cmake_dependent_option(USE_OBJECT_LIBS "Use OBJECT libraries" ON "NOT MSVC" 
OFF)
@@ -2506,6 +2496,27 @@
   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_BAK})
 endif("${HAVE_TIMESETEVENT}" MATCHES "^${HAVE_TIMESETEVENT}$")
 
+# Grumble... find_library doesn't find ws2_32.  Until we come up with
+# working tests for these, set them by hand
+if(MSVC)
+  set(COMCTL32_LIBRARY comctl32.lib)
+  set(IMM32_LIBRARY imm32.lib)
+  # TODO - mged and adrt call this specific OpenGL library out - why doesn't
+  # OPENGL_LIBRARIES do the trick?
+  set(OPENGL32_LIBRARY opengl32.lib)
+  set(PSAPI_LIB psapi.lib)
+  set(RPCRT_LIB rpcrt4.lib)
+  set(WINSOCK_LIB ws2_32.lib)
+  set(WS2_32_LIBRARY ws2_32)
+else(MSVC)
+  set(COMCTL32_LIBRARY "")
+  set(IMM32_LIBRARY "")
+  set(OPENGL32_LIBRARY "")
+  set(PSAPI_LIB "")
+  set(RPCRT_LIB "")
+  set(WINSOCK_LIB "")
+  set(WS2_32_LIBRARY "")
+endif(MSVC)
 
 # *******************************************************************
 if(BRLCAD_PRINT_MSGS)
@@ -3083,12 +3094,7 @@
     return 0;
 }
 ")
-# Grumble... find_library doesn't find ws2_32, so set it by hand.
-if(MSVC)
-  set(WS2_32_LIBRARY ws2_32)
-else(MSVC)
-  set(WS2_32_LIBRARY "")
-endif(MSVC)
+
 file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c" 
"${report_hostname_src}")
 try_run(RH_RESULT RH_COMPILED "${CMAKE_BINARY_DIR}/CMakeTmp"
   "${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c"

Modified: brlcad/branches/bioh/src/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/CMakeLists.txt     2020-05-21 14:05:20 UTC (rev 
75866)
+++ brlcad/branches/bioh/src/CMakeLists.txt     2020-05-21 14:09:11 UTC (rev 
75867)
@@ -17,13 +17,8 @@
   add_definitions(
     -D_CRT_SECURE_NO_WARNINGS
     )
-  # FIXME: these should be proper library checks, not based on MSVC "platform"
-  set(WINSOCK_LIB ws2_32.lib)
-  set(PSAPI_LIB psapi.lib)
-  set(RPCRT_LIB rpcrt4.lib)
 endif(MSVC)
 
-
 # We need to define a number of "components" to allow for easy building of
 # subsets of BRL-CAD.  We will control this process with an advanced
 # variable named BRLCAD_ENABLE_TARGETS - if set to 0 (default) everything

Modified: brlcad/branches/bioh/src/adrt/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/adrt/CMakeLists.txt        2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/adrt/CMakeLists.txt        2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -69,12 +69,8 @@
     )
   BRLCAD_INCLUDE_DIRS(isst_dirs)
 
-  set(isst_libs libtclcad librender libdm ${TCL_LIBRARY} ${OPENGL_LIBRARIES})
+  set(isst_libs libtclcad librender libdm ${TCL_LIBRARY} ${OPENGL_LIBRARIES} 
${IMM32_LIBRARY} ${COMCTL32_LIBRARY} ${OPENGL32_LIBRARY})
 
-  if(MSVC)
-    set(isst_libs ${isst_libs} imm32.lib comctl32.lib opengl32.lib)
-  endif(MSVC)
-
   BRLCAD_ADDDATA(isst.tcl tclscripts/isst)
   BRLCAD_ADDEXEC(isst isst.c "${isst_libs}" GUI)
   add_dependencies(isst isst_tcl_cp)

Modified: brlcad/branches/bioh/src/archer/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/archer/CMakeLists.txt      2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/archer/CMakeLists.txt      2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -9,12 +9,8 @@
 
 BRLCAD_ADDDATA(archer_launch.tcl tclscripts/archer)
 
-set(archer_libs libtclcad libbu ${ITCL_LIBRARY} ${ITK_LIBRARY} ${TCL_LIBRARY})
+set(archer_libs libtclcad libbu ${ITCL_LIBRARY} ${ITK_LIBRARY} ${TCL_LIBRARY} 
${IMM32_LIBRARY} ${COMCTL32_LIBRARY})
 
-if(MSVC)
-  set(archer_libs ${archer_libs} imm32.lib comctl32.lib)
-endif(MSVC)
-
 # NOTE: Building "GUI" doesn't matter except on Windows, but on Windows archer
 # currently works only in graphical mode - might as well behave "nicely" there.
 # If/when we add MGED's ability to work in "classic" mode, Archer will have

Modified: brlcad/branches/bioh/src/brlman/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/brlman/CMakeLists.txt      2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/brlman/CMakeLists.txt      2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -9,16 +9,12 @@
 
 BRLCAD_ADDDATA(brlman.tcl tclscripts/brlman)
 
-set(brlman_libs libtclcad libbu ${TCL_LIBRARY})
+set(brlman_libs libtclcad libbu ${TCL_LIBRARY} ${IMM32_LIBRARY} 
${COMCTL32_LIBRARY})
 
 if(TARGET Tkhtml)
   set(brlman_libs ${brlman_libs} Tkhtml)
 endif(TARGET Tkhtml)
 
-if(MSVC)
-  set(brlman_libs ${brlman_libs} imm32.lib comctl32.lib)
-endif(MSVC)
-
 # Building "GUI" doesn't matter except on Windows, but
 # on Windows brlman works only in graphical mode - might
 # as well behave "nicely" there.

Modified: brlcad/branches/bioh/src/bwish/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/bwish/CMakeLists.txt       2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/bwish/CMakeLists.txt       2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -25,16 +25,12 @@
 # If we have Tk enabled, we want bwish too
 if(BRLCAD_ENABLE_TK)
 
-  set(bwish_libs libtclcad libbu ${TCL_LIBRARY} ${ITCL_LIBRARY} ${TK_LIBRARY} 
${ITK_LIBRARY})
+  set(bwish_libs libtclcad libbu ${TCL_LIBRARY} ${ITCL_LIBRARY} ${TK_LIBRARY} 
${ITK_LIBRARY} ${IMM32_LIBRARY} ${COMCTL32_LIBRARY})
 
   if(TARGET libtermio)
     set(bwish_libs ${bwish_libs} libtermio)
   endif(TARGET libtermio)
 
-  if(MSVC)
-    set(bwish_libs ${bwish_libs} imm32.lib comctl32.lib )
-  endif(MSVC)
-
   BRLCAD_ADDEXEC(bwish "main.c;cmd.c;input.c" "${bwish_libs}" GUI)
   set_target_properties(bwish PROPERTIES COMPILE_DEFINITIONS "BWISH=1")
   set_target_properties(bwish PROPERTIES FOLDER "BRL-CAD Executables")

Modified: brlcad/branches/bioh/src/conv/iges/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/conv/iges/CMakeLists.txt   2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/conv/iges/CMakeLists.txt   2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -7,10 +7,6 @@
 list(REMOVE_DUPLICATES IGES_INCLUDE_DIRS)
 include_directories(${IGES_INCLUDE_DIRS})
 
-#if(MSVC)
-#  set(WIN32LIBS ${WINSOCK_LIB} Rpcrt4.lib)
-#endif(MSVC)
-
 #add_executable(iges
 #    BrepHandler.cpp
 #    brlcad_brep.cpp
@@ -17,7 +13,7 @@
 #    n_iges.cpp
 #    n_main.cpp
 #)
-#target_link_libraries(iges libwdb librt libbu ${OPENNURBS_LIBRARIES} 
${WIN32LIBS} ${M_LIBRARY})
+#target_link_libraries(iges libwdb librt libbu ${OPENNURBS_LIBRARIES} 
${WIN32LIBS} ${M_LIBRARY} ${WINSOCK_LIB} ${RPCRT_LIB})
 #install(TARGETS iges RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
 
 set(iges-g_SRCS

Modified: brlcad/branches/bioh/src/libfb/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/libfb/CMakeLists.txt       2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/libfb/CMakeLists.txt       2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -41,7 +41,7 @@
   add_definitions(
     -DIF_WGL
     )
-  set(LINKLIBS ${LINKLIBS} opengl32.lib ${TCL_LIBRARY} ${TK_LIBRARY})
+  set(LINKLIBS ${LINKLIBS} ${OPENGL32_LIBRARY} ${TCL_LIBRARY} ${TK_LIBRARY})
   set(fbwgl_srcs if_wgl.c)
   set_property(SOURCE if_wgl.c APPEND PROPERTY COMPILE_DEFINITIONS 
FB_USE_INTERNAL_API)
 endif(WIN32)

Modified: brlcad/branches/bioh/src/mged/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/mged/CMakeLists.txt        2020-05-21 14:05:20 UTC 
(rev 75866)
+++ brlcad/branches/bioh/src/mged/CMakeLists.txt        2020-05-21 14:09:11 UTC 
(rev 75867)
@@ -63,13 +63,10 @@
   wdb_obj.c
   )
 
-set(mged_libs libtclcad libged libwdb libdm libnmg ${ITCL_LIBRARY} 
${ITK_LIBRARY})
+set(mged_libs libtclcad libged libwdb libdm libnmg ${ITCL_LIBRARY} 
${ITK_LIBRARY} ${WS2_32_LIBRARY} ${OPENGL32_LIBRARY})
 if(TARGET libtermio)
   set(mged_libs ${mged_libs} libtermio)
 endif(TARGET libtermio)
-if(MSVC)
-  set(mged_libs ${mged_libs} ws2_32.lib;opengl32.lib)
-endif(MSVC)
 
 # Ideally we'd build as GUI for Windows to avoid the command window popping up,
 # but I'm not sure if that would be a problem for scripting with mged.exe on

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

Reply via email to