Revision: 70001
          http://sourceforge.net/p/brlcad/code/70001
Author:   starseeker
Date:     2017-07-26 22:45:29 +0000 (Wed, 26 Jul 2017)
Log Message:
-----------
Working on fixing Windows build after build system updates.

Modified Paths:
--------------
    brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
    brlcad/trunk/src/libbg/CMakeLists.txt
    brlcad/trunk/src/libbrep/CMakeLists.txt
    brlcad/trunk/src/libbu/CMakeLists.txt

Modified: brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
===================================================================
--- brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake        2017-07-26 20:47:51 UTC 
(rev 70000)
+++ brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake        2017-07-26 22:45:29 UTC 
(rev 70001)
@@ -139,7 +139,7 @@
 # Assemble the targets and compilation flags needed by the target
 function(GET_FLAGS_AND_DEFINITIONS targetname target_libs)
 
-  cmake_parse_arguments(G "NO_DLL;ONLY_DLL" "CFLAGS;CXXFLAGS;DEFINES" "" 
${ARGN})
+  cmake_parse_arguments(G "" "CFLAGS;CXXFLAGS;DEFINES" "" ${ARGN})
 
   #####################################################################
   # Compile flags - note that targets may have separate C and C++ flags
@@ -189,40 +189,25 @@
   # Compilation definitions (common to all source files)
 
   if(G_DEFINES)
-    if(NOT G_ONLY_DLL)
-      get_property(T_DEFINES GLOBAL PROPERTY ${targetname}_DEFINES)
-      foreach(libitem ${target_libs})
-       get_property(${libitem}_DEFINES GLOBAL PROPERTY ${libitem}_DEFINES)
-       list(APPEND T_DEFINES ${${libitem}_DEFINES})
-      endforeach(libitem ${target_libs})
-    endif(NOT G_ONLY_DLL)
 
-    # DLL definitions
-    if(NOT G_NO_DLL AND CPP_DLL_DEFINES)
+    get_property(T_DEFINES GLOBAL PROPERTY ${targetname}_DEFINES)
+    message("${targetname}_DEFINES: ${T_DEFINES}")
+    foreach(libitem ${target_libs})
+      get_property(${libitem}_DEFINES GLOBAL PROPERTY ${libitem}_DEFINES)
+      list(APPEND T_DEFINES ${${libitem}_DEFINES})
+    endforeach(libitem ${target_libs})
 
-      # Start with the target itself
-      get_property(T_DLL_DEFINES GLOBAL PROPERTY ${targetname}_DLL_DEFINES)
-      set(T_DEFINES ${T_DEFINES} ${T_DLL_DEFINES})
+    # In case of re-running cmake, make sure the DLL_IMPORTS define for this
+    # specific target is removed if the target looks like a library, since for
+    # the actual library target we need to export, not import. (Don't want to
+    # do this willy-nilly, since (for example) the rt exec target and the librt
+    # library will both map to the same "UPPER_CORE" name...)
+    if(T_DEFINES AND ${targetname} MATCHES "^lib*")
+      string(REPLACE "lib" "" LOWERCORE "${targetname}")
+      string(TOUPPER ${LOWERCORE} UPPER_CORE)
+      list(REMOVE_ITEM T_DEFINES ${UPPER_CORE}_DLL_IMPORTS)
+    endif(T_DEFINES AND ${targetname} MATCHES "^lib*")
 
-      # In case of re-running cmake, make sure the DLL_IMPORTS define for this
-      # specific target is removed if the target looks like a library, since 
for
-      # the actual library target we need to export, not import. (Don't want to
-      # do this willy-nilly, since (for example) the rt exec target and the 
librt
-      # library will both map to the same "UPPER_CORE" name...)
-      if(T_DEFINES AND ${targetname} MATCHES "^lib*")
-       string(REPLACE "lib" "" LOWERCORE "${targetname}")
-       string(TOUPPER ${LOWERCORE} UPPER_CORE)
-       list(REMOVE_ITEM T_DEFINES ${UPPER_CORE}_DLL_IMPORTS)
-      endif(T_DEFINES AND ${targetname} MATCHES "^lib*")
-
-      # See what the libraries add from a DLL perspective...
-      foreach(libitem ${target_libs})
-       get_property(${libitem}_DLL_DEFINES GLOBAL PROPERTY 
${libitem}_DLL_DEFINES)
-       list(APPEND T_DEFINES ${${libitem}_DLL_DEFINES})
-      endforeach(libitem ${target_libs})
-
-    endif(NOT G_NO_DLL AND CPP_DLL_DEFINES)
-
     # No duplicate definitions needed
     if(T_DEFINES)
       list(REMOVE_DUPLICATES T_DEFINES)
@@ -243,7 +228,7 @@
 # source file (i.e. rt, rtweight, etc...)
 function(SET_FLAGS_AND_DEFINITIONS srcslist)
 
-  cmake_parse_arguments(S "NO_STRICT_CXX" "" "CFLAGS;CXXFLAGS;DEFINES" ${ARGN})
+  cmake_parse_arguments(S "NO_STRICT_CXX" "TARGET" "CFLAGS;CXXFLAGS;DEFINES" 
${ARGN})
 
   foreach(srcfile ${srcslist})
 
@@ -288,6 +273,11 @@
 
     endif("${file_language}" STREQUAL "C++")
 
+    # If we have been supplied a target name, set the global definitions 
property
+    if(S_TARGET)
+      set_property(GLOBAL PROPERTY ${S_TARGET}_DEFINES "${S_DEFINES}")
+    endif(S_TARGET)
+
   endforeach(srcfile ${srcslist})
 
 endfunction(SET_FLAGS_AND_DEFINITIONS)
@@ -380,8 +370,9 @@
   SET_LANG_CXX("${srcslist};${L_SHARED_SRCS};${L_STATIC_SRCS}")
 
   # Handle the build flags and the general definitions common to both shared 
and static
-  GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" NO_DLL CFLAGS L_C_FLAGS 
CXXFLAGS L_CXX_FLAGS DEFINES L_GENERAL_DEFINES)
-  SET_FLAGS_AND_DEFINITIONS("${srcslist};${L_SHARED_SRCS};${L_STATIC_SRCS}" 
CFLAGS "${L_C_FLAGS}" CXXFLAGS "${L_CXX_FLAGS}" DEFINES "${L_GENERAL_DEFINES}")
+  GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" NO_DLL CFLAGS L_C_FLAGS 
CXXFLAGS L_CXX_FLAGS DEFINES L_DEFINES)
+  SET_FLAGS_AND_DEFINITIONS("${srcslist};${L_SHARED_SRCS};${L_STATIC_SRCS}" 
TARGET ${libname} CFLAGS "${L_C_FLAGS}" CXXFLAGS "${L_CXX_FLAGS}" DEFINES 
"${L_DEFINES}")
+  message("${libname}: ${L_DEFINES}")
 
   # Local copy of srcslist in case manipulation is needed
     set(lsrcslist ${srcslist})
@@ -400,10 +391,10 @@
 
   if(BUILD_SHARED_LIBS)
     add_library(${libname} SHARED ${lsrcslist}  ${L_SHARED_SRCS})
-    GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" ONLY_DLL DEFINES 
L_DLL_DEFINES)
-    foreach(dll_define ${L_DLL_DEFINES})
-      set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS 
"${dll_define}")
-    endforeach(dll_define ${L_DLL_DEFINES})
+    string(REPLACE "lib" "" LOWERCORE "${libname}")
+    string(TOUPPER ${LOWERCORE} UPPER_CORE)
+    set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS 
"${UPPER_CORE}_DLL_EXPORTS")
+    set_property(GLOBAL APPEND PROPERTY ${libname}_DEFINES 
"${UPPER_CORE}_DLL_IMPORTS")
   endif(BUILD_SHARED_LIBS)
   if(BUILD_STATIC_LIBS)
     add_library(${libname}-static STATIC ${lsrcslist} ${L_STATIC_SRCS})
@@ -431,7 +422,6 @@
 
   # If we're building the shared library, there are a few more things we need 
to do
   if(BUILD_SHARED_LIBS OR L_SHARED)
-
     set_target_properties(${libname} PROPERTIES FOLDER "BRL-CAD Shared 
Libraries${SUBFOLDER}")
     VALIDATE_STYLE("${libname}" "${srcslist};${L_SHARED_SRCS}")
     # If we have libraries to link for a shared library, link them.
@@ -444,31 +434,6 @@
        LIBRARY DESTINATION ${LIB_DIR}
        ARCHIVE DESTINATION ${LIB_DIR})
     endif(NOT L_NO_INSTALL)
-
-    # Generate the upper case abbreviation of the library that is used for
-    # DLL definitions.  If We are using DLLs, we need to define export
-    # for this library.
-    if(CPP_DLL_DEFINES)
-
-      # For this target, we need to export
-      string(REPLACE "lib" "" LOWERCORE "${libname}")
-      string(TOUPPER ${LOWERCORE} UPPER_CORE)
-      foreach(srcfile ${srcslist} ${L_SHARED_SRCS})
-       set_property(SOURCE ${srcfile} APPEND PROPERTY COMPILE_DEFINITIONS 
"${UPPER_CORE}_DLL_EXPORTS")
-      endforeach(srcfile ${srcslist} ${L_SHARED_SRCS})
-
-      # For any CPP_DLL_DEFINES DLL library, users of that library will need
-      # the DLL_IMPORTS definitions specific to that library - these are stored
-      # in ${UPPER_CORE}_DLL_DEFINES.  The particular IMPORTS definition is
-      # defined in BRL-CAD according to the below pattern - custom or
-      # additional IMPORTS will need to be added "manually" in the
-      # CMakeLists.txt files where the library targets are being defined.
-      get_property(${libname}_DLL_DEFINES GLOBAL PROPERTY 
${libname}_DLL_DEFINES)
-      list(APPEND ${libname}_DLL_DEFINES ${UPPER_CORE}_DLL_IMPORTS)
-      set_property(GLOBAL PROPERTY ${libname}_DLL_DEFINES 
"${${libname}_DLL_DEFINES}")
-
-    endif(CPP_DLL_DEFINES)
-
   endif(BUILD_SHARED_LIBS OR L_SHARED)
 
 endfunction(BRLCAD_ADDLIB libname srcslist libslist)

Modified: brlcad/trunk/src/libbg/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbg/CMakeLists.txt       2017-07-26 20:47:51 UTC (rev 
70000)
+++ brlcad/trunk/src/libbg/CMakeLists.txt       2017-07-26 22:45:29 UTC (rev 
70001)
@@ -18,7 +18,7 @@
   util.c
   )
 
-BRLCAD_ADDLIB(libbg "${LIBBG_SOURCES}" libbn libbu)
+BRLCAD_ADDLIB(libbg "${LIBBG_SOURCES}" "libbn;libbu")
 set_target_properties(libbg PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests)

Modified: brlcad/trunk/src/libbrep/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbrep/CMakeLists.txt     2017-07-26 20:47:51 UTC (rev 
70000)
+++ brlcad/trunk/src/libbrep/CMakeLists.txt     2017-07-26 22:45:29 UTC (rev 
70001)
@@ -54,12 +54,7 @@
 set(libbrep_DEFINES "")
 
 # Set libbrep compile definitions
-get_property(libbrep_DEFINES GLOBAL PROPERTY libbrep_DEFINES)
-if(CPP_DLL_DEFINES)
-  list(APPEND libbrep_DLL_DEFINES "ON_DLL_IMPORTS")
-  set_property(GLOBAL PROPERTY libbrep_DLL_DEFINES "${libbrep_DLL_DEFINES}")
-endif(CPP_DLL_DEFINES)
-set_property(GLOBAL PROPERTY libbrep_DEFINES "${libbrep_DEFINES}")
+set_property(GLOBAL PROPERTY libbrep_DEFINES "ON_DLL_IMPORTS")
 
 BRLCAD_ADDLIB(libbrep "${LIBBREP_SOURCES}" 
"libbg;libbn;libbu;${OPENNURBS_LIBRARIES};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}")
 

Modified: brlcad/trunk/src/libbu/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbu/CMakeLists.txt       2017-07-26 20:47:51 UTC (rev 
70000)
+++ brlcad/trunk/src/libbu/CMakeLists.txt       2017-07-26 22:45:29 UTC (rev 
70001)
@@ -37,9 +37,6 @@
 # Year 2038+ support lib
 set_property(SOURCE y2038/time64.c PROPERTY EXTERNAL 1)
 BRLCAD_ADDLIB(y2038 "y2038/time64.c" "")
-if(CPP_DLL_DEFINES)
-  set_property(TARGET y2038 APPEND PROPERTY COMPILE_DEFINITIONS 
"Y2038_DLL_EXPORTS")
-endif(CPP_DLL_DEFINES)
 
 set(LIBBU_SOURCES
   affinity.c
@@ -125,9 +122,6 @@
 
 BRLCAD_ADDLIB(libbu "${LIBBU_SOURCES}" 
"${CMAKE_THREAD_LIBS_INIT};${DL_LIBRARY};${WINSOCK_LIB};${PSAPI_LIB};${BSON_LIBRARIES};${UUID_LIBRARIES};${REGEX_LIBRARY};${M_LIBRARY};y2038")
 set_target_properties(libbu PROPERTIES VERSION 20.0.1 SOVERSION 20)
-if(CPP_DLL_DEFINES)
-  set_property(TARGET libbu APPEND PROPERTY COMPILE_DEFINITIONS 
"Y2038_DLL_IMPORTS")
-endif(CPP_DLL_DEFINES)
 
 BRLCAD_ADDDATA(fix.6r vfont)
 BRLCAD_ADDDATA(nonie.r.12 vfont)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to