Revision: 58300
          http://sourceforge.net/p/brlcad/code/58300
Author:   brlcad
Date:     2013-10-25 17:49:08 +0000 (Fri, 25 Oct 2013)
Log Message:
-----------
separation of macro definition from macro use.  move the compiler logic into 
the compiler section of the top-level CMakeLists.txt file so that we can 
unconditionally include the macro definitions like a template header.

Modified Paths:
--------------
    brlcad/trunk/CMakeLists.txt
    brlcad/trunk/misc/CMake/CompilerFlags.cmake

Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2013-10-25 17:45:47 UTC (rev 58299)
+++ brlcad/trunk/CMakeLists.txt 2013-10-25 17:49:08 UTC (rev 58300)
@@ -1459,6 +1459,216 @@
   include(${BRLCAD_CMAKE_DIR}/BRLCAD_CompilerFlags.cmake)
 endif(NOT MSVC)
 
+# Clear out most CMake-assigned defaults - We're managing
+# our own compile flags, and don't (for example) want NDEBUG
+# if we have debugging flags enabled for a Release build.
+# At the same time, pull in any flags that have been set
+# in the environment.
+
+set(CMAKE_C_FLAGS "")
+set(CMAKE_CXX_FLAGS "")
+set(CMAKE_SHARED_LINKER_FLAGS "")
+set(CMAKE_EXE_LINKER_FLAGS "")
+
+if(CMAKE_BUILD_TYPE)
+  string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
+  set(CMAKE_C_FLAGS_${BUILD_TYPE_UPPER} "")
+  set(CMAKE_CXX_FLAGS_${BUILD_TYPE_UPPER} "")
+  set(CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE_UPPER} "")
+  set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE_UPPER} "")
+endif(CMAKE_BUILD_TYPE)
+
+foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
+  string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
+  set(CMAKE_C_FLAGS_${CFG_TYPE_UPPER} "")
+  set(CMAKE_CXX_FLAGS_${CFG_TYPE_UPPER} "")
+  set(CMAKE_SHARED_LINKER_FLAGS_${CFG_TYPE_UPPER} "")
+  set(CMAKE_EXE_LINKER_FLAGS_${CFG_TYPE_UPPER} "")
+endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
+
+set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
+set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}")
+#set(CMAKE_EXE_LINKER_FLAGS "")
+
+# try to use -pipe to speed up the compiles
+CHECK_C_FLAG(pipe)
+CHECK_CXX_FLAG(pipe)
+
+# check for -fno-strict-aliasing
+# XXX - THIS FLAG IS REQUIRED if any level of optimization is
+# enabled with GCC as we do use aliasing and type-punning.
+CHECK_C_FLAG(fno-strict-aliasing)
+CHECK_CXX_FLAG(fno-strict-aliasing)
+
+# check for -fno-common (libtcl needs it on darwin)
+CHECK_C_FLAG(fno-common)
+CHECK_CXX_FLAG(fno-common)
+
+# check for -fexceptions
+# this is needed to resolve __Unwind_Resume when compiling and
+# linking against openNURBS in librt for some binaries, for
+# example rttherm (i.e. any -static binaries)
+CHECK_C_FLAG(fexceptions)
+CHECK_CXX_FLAG(fexceptions)
+
+# check for -ftemplate-depth-NN this is needed in libpc and
+# other code using boost where the template instantiation depth
+# needs to be increased from the default ANSI minimum of 17.
+CHECK_CXX_FLAG(ftemplate-depth-128)
+
+# dynamic SSE optimizations for NURBS processing
+#
+# XXX disable the SSE flags for now as they can cause illegal instructions.
+#     the test needs to also be tied to run-time functionality since gcc
+#     may still output SSE instructions (e.g., for cross-compiling).
+# CHECK_C_FLAG(msse)
+# CHECK_C_FLAG(msse2)
+CHECK_C_FLAG(msse3 BUILD_TYPES Debug)
+
+# Check for c90 support with gnu extensions if we're not building for
+# a release so we get more broad portability testing.  Since the
+# default is debug, it will be the more difficult to keep working
+# given it's the lesser feature-rich C standard.  If we're going for
+# a strictly standard compliant build, use the c** options instead
+# of the gnu variations
+if(ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE)
+  CHECK_C_FLAG("std=c99" BUILD_TYPES Debug)
+  CHECK_C_FLAG("std=c99" BUILD_TYPES Release VARS C99_FLAG)
+  # we need to define some things as "empty" to avoid false positives
+  # for bu_* functions using varargs and print specifiers
+  CHECK_C_FLAG("D_BU_ATTR_PRINTF12=''")
+  CHECK_C_FLAG("D_BU_ATTR_PRINTF23=''")
+  CHECK_C_FLAG("D_BU_ATTR_SCANF23=''")
+  # a hack to temp work around signal() handling in interrupt.c
+  CHECK_C_FLAG("DC99_POSIX_USE_BSD")
+else()
+  CHECK_C_FLAG("std=gnu89" BUILD_TYPES Debug)
+  CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
+endif()
+
+# What POSIX do we want to target, initially?  See
+# http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+# for options...
+if(ENABLE_POSIX_COMPLIANCE)
+  # use this version so three non-C99 functions (without bu*
+  # replacements) will work:
+  CHECK_C_FLAG("D_POSIX_C_SOURCE=200112L")
+  # need this for glibc < 2.12 (for gethostname):
+  CHECK_C_FLAG("D_XOPEN_SOURCE=500")
+endif()
+
+# Silence check for unused arguments (used to silence clang warnings about
+# unused options on the command line). By default clang generates a lot of
+# warnings about such arguments, and we don't really care.
+CHECK_C_FLAG(Qunused-arguments)
+CHECK_CXX_FLAG(Qunused-arguments)
+
+# 64bit compilation flags
+if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+  CHECK_C_FLAG(m64 VARS 64BIT_FLAG)
+  CHECK_C_FLAG("arch x86_64" VARS 64BIT_FLAG)
+  CHECK_C_FLAG(64 VARS 64BIT_FLAG)
+  CHECK_C_FLAG("mabi=64" VARS  64BIT_FLAG)
+  if(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
+    message(FATAL_ERROR "Trying to compile 64BIT but all 64 bit compiler flag 
tests failed!")
+  endif(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
+  CHECK_C_FLAG(q64 VARS 64BIT_FLAG)
+  ADD_NEW_FLAG(C 64BIT_FLAG ALL)
+  ADD_NEW_FLAG(CXX 64BIT_FLAG ALL)
+  ADD_NEW_FLAG(SHARED_LINKER 64BIT_FLAG ALL)
+  ADD_NEW_FLAG(EXE_LINKER 64BIT_FLAG ALL)
+endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+
+# 32 bit compilation flags
+if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES 
"AUTO")
+  CHECK_C_FLAG(m32 VARS 32BIT_FLAG)
+  CHECK_C_FLAG("arch i686" VARS 32BIT_FLAG)
+  CHECK_C_FLAG(32 VARS 32BIT_FLAG)
+  CHECK_C_FLAG("mabi=32" VARS 32BIT_FLAG)
+  CHECK_C_FLAG(q32 VARS 32BIT_FLAG)
+  if(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
+    message(FATAL_ERROR "Trying to compile 32BIT but all 32 bit compiler flag 
tests failed!")
+  endif(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
+  ADD_NEW_FLAG(C 32BIT_FLAG ALL)
+  ADD_NEW_FLAG(CXX 32BIT_FLAG ALL)
+  ADD_NEW_FLAG(SHARED_LINKER 32BIT_FLAG ALL)
+  ADD_NEW_FLAG(EXE_LINKER 32BIT_FLAG ALL)
+endif(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES 
"AUTO")
+
+if(BRLCAD_ENABLE_PROFILING)
+  CHECK_C_FLAG(pg VARS PROFILE_FLAG)
+  CHECK_C_FLAG(p VARS PROFILE_FLAG)
+  CHECK_C_FLAG(prof_gen VARS PROFILE_FLAG)
+  if(NOT PROFILE_FLAG)
+    message("Warning - profiling requested, but don't know how to profile with 
this compiler - disabling.")
+    set(BRLCAD_ENABLE_PROFILING OFF)
+  else(NOT PROFILE_FLAG)
+    ADD_NEW_FLAG(C PROFILE_FLAG ALL)
+    ADD_NEW_FLAG(CXX PROFILE_FLAG ALL)
+  endif(NOT PROFILE_FLAG)
+endif(BRLCAD_ENABLE_PROFILING)
+
+# Debugging flags
+if(BRLCAD_FLAGS_DEBUG)
+  CHECK_C_FLAG(g GROUPS DEBUG_C_FLAGS)
+  CHECK_CXX_FLAG(g GROUPS DEBUG_CXX_FLAGS)
+  if(APPLE)
+    EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
+    if(${MACOSX_VERSION} VERSION_LESS "10.5")
+      CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
+      CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
+    else(${MACOSX_VERSION} VERSION_LESS "10.5")
+      # CHECK_C_COMPILER_FLAG silently eats gstabs+ - also, compiler
+      # apparently doesn't like mixing stabs with another debug flag.
+      set(DEBUG_C_FLAGS "-ggdb")
+      set(DEBUG_CXX_FLAGS "-ggdb")
+    endif(${MACOSX_VERSION} VERSION_LESS "10.5")
+  else(APPLE)
+    CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
+    CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
+  endif(APPLE)
+  if(CMAKE_CONFIGURATION_TYPES)
+    set(debug_config_list "${CMAKE_CONFIGURATION_TYPES}")
+  else(CMAKE_CONFIGURATION_TYPES)
+    set(debug_config_list "ALL")
+  endif(CMAKE_CONFIGURATION_TYPES)
+  ADD_NEW_FLAG(C DEBUG_C_FLAGS "${debug_config_list}")
+  ADD_NEW_FLAG(CXX DEBUG_CXX_FLAGS "${debug_config_list}")
+  # TODO - need to figure out a way to actually test linker flags
+  ADD_NEW_FLAG(SHARED_LINKER DEBUG_C_FLAGS "${debug_config_list}")
+  ADD_NEW_FLAG(EXE_LINKER DEBUG_C_FLAGS "${debug_config_list}")
+  mark_as_advanced(DEBUG_FLAGS)
+endif(BRLCAD_FLAGS_DEBUG)
+
+
+# Set the minimum compilation linkage for Mac systems if not already
+# set, no harm if set elsewhere.
+if(APPLE)
+  set(MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
+  if(NOT MACOSX_DEPLOYMENT_TARGET)
+    set(ENV(MACOSX_DEPLOYMENT_TARGET) "10.3")
+  endif(NOT MACOSX_DEPLOYMENT_TARGET)
+
+  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
+    CHECK_C_FLAG("mmacosx-version-min=10.3 -isysroot 
/Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
+  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
+  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
+    CHECK_C_FLAG("mmacosx-version-min=10.4 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
+  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
+  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
+    CHECK_C_FLAG("mmacosx-version-min=10.5 -isysroot 
/Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
+  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
+  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
+    CHECK_C_FLAG("mmacosx-version-min=10.6 -isysroot 
/Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
+  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
+
+  ADD_NEW_FLAG(C SDK_FLAG ALL)
+  ADD_NEW_FLAG(CXX SDK_FLAG ALL)
+  ADD_NEW_FLAG(SHARED_LINKER SDK_FLAG ALL)
+  ADD_NEW_FLAG(EXE_LINKER SDK_FLAG ALL)
+endif(APPLE)
+
 # Most of the src/other projects have their own logic for handling
 # the C inline issue - BRL-CAD needs a fine-grained approach.  Mixed
 # C and C++ sources require different treatment for the same build

Modified: brlcad/trunk/misc/CMake/CompilerFlags.cmake
===================================================================
--- brlcad/trunk/misc/CMake/CompilerFlags.cmake 2013-10-25 17:45:47 UTC (rev 
58299)
+++ brlcad/trunk/misc/CMake/CompilerFlags.cmake 2013-10-25 17:49:08 UTC (rev 
58300)
@@ -183,216 +183,6 @@
   CHECK_FLAG(CXX ${ARGN})
 endmacro(CHECK_CXX_FLAG)
 
-# Clear out most CMake-assigned defaults - We're managing
-# our own compile flags, and don't (for example) want NDEBUG
-# if we have debugging flags enabled for a Release build.
-# At the same time, pull in any flags that have been set
-# in the environment.
-
-set(CMAKE_C_FLAGS "")
-set(CMAKE_CXX_FLAGS "")
-set(CMAKE_SHARED_LINKER_FLAGS "")
-set(CMAKE_EXE_LINKER_FLAGS "")
-
-if(CMAKE_BUILD_TYPE)
-  string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
-  set(CMAKE_C_FLAGS_${BUILD_TYPE_UPPER} "")
-  set(CMAKE_CXX_FLAGS_${BUILD_TYPE_UPPER} "")
-  set(CMAKE_SHARED_LINKER_FLAGS_${BUILD_TYPE_UPPER} "")
-  set(CMAKE_EXE_LINKER_FLAGS_${BUILD_TYPE_UPPER} "")
-endif(CMAKE_BUILD_TYPE)
-
-foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-  string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
-  set(CMAKE_C_FLAGS_${CFG_TYPE_UPPER} "")
-  set(CMAKE_CXX_FLAGS_${CFG_TYPE_UPPER} "")
-  set(CMAKE_SHARED_LINKER_FLAGS_${CFG_TYPE_UPPER} "")
-  set(CMAKE_EXE_LINKER_FLAGS_${CFG_TYPE_UPPER} "")
-endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-
-set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
-set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}")
-set(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}")
-#set(CMAKE_EXE_LINKER_FLAGS "")
-
-# try to use -pipe to speed up the compiles
-CHECK_C_FLAG(pipe)
-CHECK_CXX_FLAG(pipe)
-
-# check for -fno-strict-aliasing
-# XXX - THIS FLAG IS REQUIRED if any level of optimization is
-# enabled with GCC as we do use aliasing and type-punning.
-CHECK_C_FLAG(fno-strict-aliasing)
-CHECK_CXX_FLAG(fno-strict-aliasing)
-
-# check for -fno-common (libtcl needs it on darwin)
-CHECK_C_FLAG(fno-common)
-CHECK_CXX_FLAG(fno-common)
-
-# check for -fexceptions
-# this is needed to resolve __Unwind_Resume when compiling and
-# linking against openNURBS in librt for some binaries, for
-# example rttherm (i.e. any -static binaries)
-CHECK_C_FLAG(fexceptions)
-CHECK_CXX_FLAG(fexceptions)
-
-# check for -ftemplate-depth-NN this is needed in libpc and
-# other code using boost where the template instantiation depth
-# needs to be increased from the default ANSI minimum of 17.
-CHECK_CXX_FLAG(ftemplate-depth-128)
-
-# dynamic SSE optimizations for NURBS processing
-#
-# XXX disable the SSE flags for now as they can cause illegal instructions.
-#     the test needs to also be tied to run-time functionality since gcc
-#     may still output SSE instructions (e.g., for cross-compiling).
-# CHECK_C_FLAG(msse)
-# CHECK_C_FLAG(msse2)
-CHECK_C_FLAG(msse3 BUILD_TYPES Debug)
-
-# Check for c90 support with gnu extensions if we're not building for
-# a release so we get more broad portability testing.  Since the
-# default is debug, it will be the more difficult to keep working
-# given it's the lesser feature-rich C standard.  If we're going for
-# a strictly standard compliant build, use the c** options instead
-# of the gnu variations
-if(ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE)
-  CHECK_C_FLAG("std=c99" BUILD_TYPES Debug)
-  CHECK_C_FLAG("std=c99" BUILD_TYPES Release VARS C99_FLAG)
-  # we need to define some things as "empty" to avoid false positives
-  # for bu_* functions using varargs and print specifiers
-  CHECK_C_FLAG("D_BU_ATTR_PRINTF12=''")
-  CHECK_C_FLAG("D_BU_ATTR_PRINTF23=''")
-  CHECK_C_FLAG("D_BU_ATTR_SCANF23=''")
-  # a hack to temp work around signal() handling in interrupt.c
-  CHECK_C_FLAG("DC99_POSIX_USE_BSD")
-else()
-  CHECK_C_FLAG("std=gnu89" BUILD_TYPES Debug)
-  CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
-endif()
-
-# What POSIX do we want to target, initially?  See
-# http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
-# for options...
-if(ENABLE_POSIX_COMPLIANCE)
-  # use this version so three non-C99 functions (without bu*
-  # replacements) will work:
-  CHECK_C_FLAG("D_POSIX_C_SOURCE=200112L")
-  # need this for glibc < 2.12 (for gethostname):
-  CHECK_C_FLAG("D_XOPEN_SOURCE=500")
-endif()
-
-# Silence check for unused arguments (used to silence clang warnings about
-# unused options on the command line). By default clang generates a lot of
-# warnings about such arguments, and we don't really care.
-CHECK_C_FLAG(Qunused-arguments)
-CHECK_CXX_FLAG(Qunused-arguments)
-
-# 64bit compilation flags
-if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-  CHECK_C_FLAG(m64 VARS 64BIT_FLAG)
-  CHECK_C_FLAG("arch x86_64" VARS 64BIT_FLAG)
-  CHECK_C_FLAG(64 VARS 64BIT_FLAG)
-  CHECK_C_FLAG("mabi=64" VARS  64BIT_FLAG)
-  if(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
-    message(FATAL_ERROR "Trying to compile 64BIT but all 64 bit compiler flag 
tests failed!")
-  endif(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
-  CHECK_C_FLAG(q64 VARS 64BIT_FLAG)
-  ADD_NEW_FLAG(C 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(CXX 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER 64BIT_FLAG ALL)
-endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-
-# 32 bit compilation flags
-if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES 
"AUTO")
-  CHECK_C_FLAG(m32 VARS 32BIT_FLAG)
-  CHECK_C_FLAG("arch i686" VARS 32BIT_FLAG)
-  CHECK_C_FLAG(32 VARS 32BIT_FLAG)
-  CHECK_C_FLAG("mabi=32" VARS 32BIT_FLAG)
-  CHECK_C_FLAG(q32 VARS 32BIT_FLAG)
-  if(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
-    message(FATAL_ERROR "Trying to compile 32BIT but all 32 bit compiler flag 
tests failed!")
-  endif(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
-  ADD_NEW_FLAG(C 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(CXX 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER 32BIT_FLAG ALL)
-endif(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES 
"AUTO")
-
-if(BRLCAD_ENABLE_PROFILING)
-  CHECK_C_FLAG(pg VARS PROFILE_FLAG)
-  CHECK_C_FLAG(p VARS PROFILE_FLAG)
-  CHECK_C_FLAG(prof_gen VARS PROFILE_FLAG)
-  if(NOT PROFILE_FLAG)
-    message("Warning - profiling requested, but don't know how to profile with 
this compiler - disabling.")
-    set(BRLCAD_ENABLE_PROFILING OFF)
-  else(NOT PROFILE_FLAG)
-    ADD_NEW_FLAG(C PROFILE_FLAG ALL)
-    ADD_NEW_FLAG(CXX PROFILE_FLAG ALL)
-  endif(NOT PROFILE_FLAG)
-endif(BRLCAD_ENABLE_PROFILING)
-
-# Debugging flags
-if(BRLCAD_FLAGS_DEBUG)
-  CHECK_C_FLAG(g GROUPS DEBUG_C_FLAGS)
-  CHECK_CXX_FLAG(g GROUPS DEBUG_CXX_FLAGS)
-  if(APPLE)
-    EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
-    if(${MACOSX_VERSION} VERSION_LESS "10.5")
-      CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
-      CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
-    else(${MACOSX_VERSION} VERSION_LESS "10.5")
-      # CHECK_C_COMPILER_FLAG silently eats gstabs+ - also, compiler
-      # apparently doesn't like mixing stabs with another debug flag.
-      set(DEBUG_C_FLAGS "-ggdb")
-      set(DEBUG_CXX_FLAGS "-ggdb")
-    endif(${MACOSX_VERSION} VERSION_LESS "10.5")
-  else(APPLE)
-    CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
-    CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
-  endif(APPLE)
-  if(CMAKE_CONFIGURATION_TYPES)
-    set(debug_config_list "${CMAKE_CONFIGURATION_TYPES}")
-  else(CMAKE_CONFIGURATION_TYPES)
-    set(debug_config_list "ALL")
-  endif(CMAKE_CONFIGURATION_TYPES)
-  ADD_NEW_FLAG(C DEBUG_C_FLAGS "${debug_config_list}")
-  ADD_NEW_FLAG(CXX DEBUG_CXX_FLAGS "${debug_config_list}")
-  # TODO - need to figure out a way to actually test linker flags
-  ADD_NEW_FLAG(SHARED_LINKER DEBUG_C_FLAGS "${debug_config_list}")
-  ADD_NEW_FLAG(EXE_LINKER DEBUG_C_FLAGS "${debug_config_list}")
-  mark_as_advanced(DEBUG_FLAGS)
-endif(BRLCAD_FLAGS_DEBUG)
-
-
-# Set the minimum compilation linkage for Mac systems if not already
-# set, no harm if set elsewhere.
-if(APPLE)
-  set(MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
-  if(NOT MACOSX_DEPLOYMENT_TARGET)
-    set(ENV(MACOSX_DEPLOYMENT_TARGET) "10.3")
-  endif(NOT MACOSX_DEPLOYMENT_TARGET)
-
-  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
-    CHECK_C_FLAG("mmacosx-version-min=10.3 -isysroot 
/Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
-  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
-  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
-    CHECK_C_FLAG("mmacosx-version-min=10.4 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
-  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
-  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
-    CHECK_C_FLAG("mmacosx-version-min=10.5 -isysroot 
/Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
-  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
-  if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
-    CHECK_C_FLAG("mmacosx-version-min=10.6 -isysroot 
/Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
-  endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
-
-  ADD_NEW_FLAG(C SDK_FLAG ALL)
-  ADD_NEW_FLAG(CXX SDK_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER SDK_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER SDK_FLAG ALL)
-endif(APPLE)
-
 # Local Variables:
 # tab-width: 8
 # mode: cmake

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to