Skip to content

Commit

Permalink
Merge pull request #361 from MFraters/add_cmake_debug_and_release_swi…
Browse files Browse the repository at this point in the history
…tching_commands

Add cmake debug and release switching commands
  • Loading branch information
MFraters authored Oct 31, 2021
2 parents 0450963 + eddb547 commit 462d2a3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Information about the depth of the reference surface in the PointDistanceFromCurvedPlanes structure. \[Menno Fraters; 2021-07-20; [#320](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/320)\]
- The option for a smooth slab temperature structure that conserves mass with distance along the slab surface. \[Magali Billen; 2021-07-28; [#323](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/323)\]
- The option for a temperature model for an oceanic plate with a constant age using the plate model. \[Haoyuan Li; 2021-10-29; [#344](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/344)\]
- The cmake targets to easily switch between debug and release mode \[Menno Fraters; 2021-10-31; [#361](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/361)\]

### Changed
- The World Builder Visualizer will now use zlib compression for vtu files by default. If zlib is not available binary output will be used. \[Menno Fraters; 2021-06-26; [#282](github.com/GeodynamicWorldBuilder/WorldBuilder/pull/282)\]
Expand Down
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ if(MAKE_PYTHON_WRAPPER)

endif()

# Find if we are using make or ninja.
IF(CMAKE_GENERATOR MATCHES "Ninja")
SET(_make_command "ninja")
ELSE()
SET(_make_command "make")
ENDIF()

# Provide "indent" target for indenting all headers and source files
ADD_CUSTOM_TARGET(indent
Expand All @@ -288,6 +294,25 @@ ADD_CUSTOM_TARGET(indent
COMMENT "Indenting all the World Builder header and source files..."
)

# Provide "release" target for switching to release mode
ADD_CUSTOM_TARGET(release
COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Release .
COMMAND ${CMAKE_COMMAND} -E echo "Switched to Release mode. Now recompile with: ${_make_command}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
COMMENT "switching to RELEASE mode..."
)


# Provide "debug" target for switching to release mode
ADD_CUSTOM_TARGET(debug
COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Debug .
COMMAND ${CMAKE_COMMAND} -E echo "Switched to Debug mode. Now recompile with: ${_make_command}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
COMMENT "switching to DEBUG mode..."
)


SET(FORCE_COLORED_OUTPUT ON CACHE BOOL "Forces colored ouput when compiling with gcc and clang.")

Expand Down

0 comments on commit 462d2a3

Please sign in to comment.