Difference between revisions of "Talk:Building using CMake"

(cmake option-source order altered)
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
An example of command-lines for a local build:
 
An example of command-lines for a local build:
 
* OSG/cmake.txt:
 
* OSG/cmake.txt:
  cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall"\
+
  cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native  -mfpmath=sse -Wall"\
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" $1
+
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" $1
 
* SimGear/cmake.txt:
 
* SimGear/cmake.txt:
   cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall"\
+
   cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native  -mfpmath=sse -Wall"\
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" -D JPEG_FACTORY:BOOL="ON" $1
+
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native  -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" -D JPEG_FACTORY:BOOL="ON" $1
 
* FlightGear/cmake.txt:
 
* FlightGear/cmake.txt:
  cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall"\
+
  cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native -mfpmath=sse -Wall"\
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=core2 -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" $1
+
  -D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" -D FG_DATA_DIR="/some/path/" $1
  
Apparently, -D FG_DATA_DIR="/some/path/" will set the default FG_ROOT
+
 
 +
 
 +
Changed the order of cmake's source path and option as suggested by [http://linux.die.net/man/1/cmake <code>man cmake</code>]. This is to prevent makeing new users of cmake confused. It also has the advantage that options like "-D CMAKE_SOME_OPTION=something" (instead of "-DCMAKE_...") do work. If you don't like that change, just undo it, thanks.
 +
[[User:Flughund|Flughund]] 11:54, 21 August 2012 (EDT)

Latest revision as of 11:54, 21 August 2012

These are some handy switches

  • -D CMAKE_VERBOSE_MAKEFILE=TRUE : get the make-style actual commands instead of just the progress indications.
  • -D CMAKE_BUILD_TYPE="RELWITHDEBINFO" : Use some optimization

An example of command-lines for a local build:

  • OSG/cmake.txt:
cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe  -march=native -mtune=native  -mfpmath=sse -Wall"\
-D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe  -march=native -mtune=native -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" $1
  • SimGear/cmake.txt:
 cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe  -march=native -mtune=native  -mfpmath=sse -Wall"\
-D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe  -march=native -mtune=native  -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" -D JPEG_FACTORY:BOOL="ON" $1
  • FlightGear/cmake.txt:
cmake -D CMAKE_BUILD_TYPE:STRING="Release" -D CMAKE_CXX_FLAGS_RELEASE:STRING="-O3 -g -pipe  -march=native -mtune=native -mfpmath=sse -Wall"\
-D CMAKE_C_FLAGS_RELEASE:STRING="-O3 -g -pipe -march=native -mtune=native -mfpmath=sse -Wall" -D CMAKE_INSTALL_PREFIX:PATH="$HOME/FlightGear/fg.git" -D FG_DATA_DIR="/some/path/" $1


Changed the order of cmake's source path and option as suggested by man cmake. This is to prevent makeing new users of cmake confused. It also has the advantage that options like "-D CMAKE_SOME_OPTION=something" (instead of "-DCMAKE_...") do work. If you don't like that change, just undo it, thanks. Flughund 11:54, 21 August 2012 (EDT)

Return to "Building using CMake" page.