Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Don't force Release build. Fixes -DCMAKE_RELAEASE_TYPE not working #673

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ project(PotreeConverter LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)

# Set the default build type in a way that keeps it overridable from the CLI.
# From: https://stackoverflow.com/questions/48832233/have-a-cmake-project-default-to-the-release-build-type/48832234#48832234
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

#message(${PROJECT_SOURCE_DIR})

Expand Down
6 changes: 5 additions & 1 deletion Converter/libs/laszip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ target_include_directories(laszip PRIVATE
../
)

set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
# Set the default build type in a way that keeps it overridable from the CLI.
# From: https://stackoverflow.com/questions/48832233/have-a-cmake-project-default-to-the-release-build-type/48832234#48832234
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()

add_compile_definitions(OPENCV_VERSION=${OpenCV_VERSION})
add_compile_definitions(_CRT_SECURE_NO_DEPRECATE)
Expand Down