Skip to content

Commit

Permalink
[build] Set default build type to RelWithDebInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
fador authored and Jovasa committed Jan 3, 2024
1 parent 11b8d07 commit 925f9cf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ option(BUILD_SHARED_LIBS "Build using shared kvazaar library" ON)

option(BUILD_TESTS "Build tests" ON)

# https://www.kitware.com/cmake-and-the-default-build-type/
# Set a default build type if none was specified
set(KVZ_DEFAULT_BUILD_TYPE "RelWithDebInfo")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type specified, setting to '${KVZ_DEFAULT_BUILD_TYPE}'.")
set(CMAKE_BUILD_TYPE "${KVZ_DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()


find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
Expand Down Expand Up @@ -274,7 +287,7 @@ add_custom_target(distcheck
&& echo \"\\033[0;32mTests ok\\033[m\"
&& make install >> ${PROJECT_SOURCE_DIR}/distcheck.log || { echo \"\\033[0;31mmake install failed.\\033[m\"$<SEMICOLON> exit 1$<SEMICOLON> }
&& echo \"\\033[0;32mInstall ok\\033[m\"
&& bin/uvg266 --help >> ${PROJECT_SOURCE_DIR}/distcheck.log || { echo \"\\033[0;31mkvazaar binary failed to run.\\033[m\"$<SEMICOLON> exit 1$<SEMICOLON> }
&& bin/kvzaar --help >> ${PROJECT_SOURCE_DIR}/distcheck.log || { echo \"\\033[0;31mkvazaar binary failed to run.\\033[m\"$<SEMICOLON> exit 1$<SEMICOLON> }
&& echo \"\\033[0;32mbin/kvazaar ok\\033[m\"
&& make clean >> ${PROJECT_SOURCE_DIR}/distcheck.log || { echo \"\\033[0;31mmake clean failed.\\033[m\"$<SEMICOLON> exit 1$<SEMICOLON> }
&& echo \"\\033[0;32mmake clean ok\\033[m\"
Expand Down

0 comments on commit 925f9cf

Please sign in to comment.