Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r529 - trunk
- Date: Fri, 2 Sep 2005 12:27:04 -0600 (MDT)
Author: bigler
Date: Fri Sep 2 12:27:04 2005
New Revision: 529
Modified:
trunk/CMakeLists.txt
Log:
If you haven't set the build type, set it to "Release". Shouldn't
affect an existing non-blank setting.
Added FIRST_TIME_SET macro to allow setting default options the first
time you configure with CMake. Build for SGI and Mac use it for
compiler options.
Added a couple of commented out functions for forcing a mininum
version of CMake, and adding forcing a variable to have a particular
argument without changing the existing set of arguments.
Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt (original)
+++ trunk/CMakeLists.txt Fri Sep 2 12:27:04 2005
@@ -2,6 +2,11 @@
# many system dependent action. We will try and keep all that in this
# file rather than in subdirectories.
+# # You need at least CMake version 2.0
+# IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.0)
+# MESSAGE(FATAL_ERROR "You need at least version 2.0. Go get it from
http://www.cmake.org/HTML/Download.html")
+# ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.0)
+
PROJECT (Manta)
SET(BUILD_SHARED_LIBS ON)
@@ -34,18 +39,48 @@
INCLUDE (${CMAKE_ROOT}/Modules/FindThreads.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
-# Do we have sproc? For now this is forced.
+# #################################################################
+# ### ADD_CXX_FLAGS(flags) ###
+# ### flags will be added to CMAKE_CXX_FLAGS, but only once ###
+# ### This only works for CMake 2.0 and above. ###
+# #################################################################
+# MACRO(FORCE_ADD_CXX_FLAGS)
+# FOREACH(arg ${ARGN})
+# SET(TMP ${arg}) #elsewise the Seperate command doesn't work)
+# SEPARATE_ARGUMENTS(TMP)
+# FOREACH(option ${TMP})
+# STRING(REGEX REPLACE " ${option}" "" CMAKE_CXX_FLAGS
+# "${CMAKE_CXX_FLAGS}")
+# STRING(REGEX REPLACE "${option}" "" CMAKE_CXX_FLAGS
+# "${CMAKE_CXX_FLAGS}")
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${option}" CACHE STRING
+# "common C++ build flags" FORCE)
+# ENDFOREACH(option ${TMP})
+# ENDFOREACH(arg ${ARGN})
+# ENDMACRO(FORCE_ADD_CXX_FLAGS)
+
+# This MACRO is designed to set variables to default values only on
+# the first configure. Subsequent configures will produce no ops.
+MACRO(FIRST_TIME_SET VARIABLE VALUE TYPE COMMENT)
+ IF(NOT PASSED_FIRST_CONFIGURE)
+ SET(${VARIABLE} ${VALUE} CACHE ${TYPE} ${COMMENT} FORCE)
+ ENDIF(NOT PASSED_FIRST_CONFIGURE)
+ENDMACRO(FIRST_TIME_SET)
+
+
+###################################################
+
IF(CMAKE_SYSTEM MATCHES IRIX)
+ # For now force sproc on IRIX systems.
# MESSAGE("Forcing Irix Threads")
SET(CMAKE_USE_SPROC_INIT 1)
SET(CMAKE_USE_PTHREADS_INIT 0)
SET(CMAKE_THREAD_LIBS_INIT -lfetchop)
# Check for CC compiler and add -LANG:std to it
IF(CMAKE_CXX_COMPILER MATCHES "CC")
- SET(CMAKE_CXX_FLAGS "-LANG:std"
- CACHE STRING "Standard CXX flags" FORCE)
- SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -OPT:IEEE_arithmetic=3"
- CACHE STRING "Optimized Flags" FORCE)
+ FIRST_TIME_SET(CMAKE_CXX_FLAGS "-LANG:std" STRING "Standard CXX flags")
+ FIRST_TIME_SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -OPT:IEEE_arithmetic=3"
+ STRING "Optimized Flags")
ENDIF(CMAKE_CXX_COMPILER MATCHES "CC")
ELSE(CMAKE_SYSTEM MATCHES IRIX)
# MESSAGE("IRIX not found")
@@ -53,7 +88,7 @@
IF (APPLE)
- SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -fgcse-sm -funroll-loops
-fstrict-aliasing -fsched-interblock -falign-loops=16 -falign-jumps=16
-falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15
-ffast-math -freorder-blocks -mpowerpc-gpopt -force_cpusubtype_ALL -mtune=G5
-mcpu=G5 -mpowerpc64 -faltivec -mabi=altivec -mpowerpc-gfxopt" CACHE STRING
"Optimized Flags" FORCE)
+ FIRST_TIME_SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -fgcse-sm -funroll-loops
-fstrict-aliasing -fsched-interblock -falign-loops=16 -falign-jumps=16
-falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15
-ffast-math -freorder-blocks -mpowerpc-gpopt -force_cpusubtype_ALL -mtune=G5
-mcpu=G5 -mpowerpc64 -faltivec -mabi=altivec -mpowerpc-gfxopt" STRING
"Optimized Flags")
ENDIF (APPLE)
IF (OPENGL_INCLUDE_PATH)
@@ -92,5 +127,10 @@
SUBDIRS( ${MAIN_SUBDIRS} )
+
+# Now that everything is done indicate that we have finished
+# configuring at least once.
+
+SET(PASSED_FIRST_CONFIGURE ON CACHE INTERNAL "Already Configured once?")
- [MANTA] r529 - trunk, bigler, 09/02/2005
Archive powered by MHonArc 2.6.16.