Skip to content

Commit 2a0f6ba

Browse files
committed
CMake: don't touch CMAKE_INSTALL_PREFIX when LSL_PRESERVE_INSTALL_PREFIX is set
1 parent 17a5052 commit 2a0f6ba

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmake/LSLCMake.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@
66
macro(LSLAPP_Setup_Boilerplate)
77
endmacro()
88

9-
message(STATUS "Included LSL CMake helpers, rev. 12, ${CMAKE_CURRENT_LIST_DIR}")
9+
message(STATUS "Included LSL CMake helpers, rev. 13, ${CMAKE_CURRENT_LIST_DIR}")
1010
option(LSL_DEPLOYAPPLIBS "Copy library dependencies (at the moment Qt + liblsl) to the installation dir" ON)
1111

12-
# set build type and default install dir if not done already
12+
# set build type and default install dir if not done already or undesired
1313
if(NOT CMAKE_BUILD_TYPE)
1414
message(STATUS "CMAKE_BUILD_TYPE was default initialized to Release")
1515
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
1616
endif()
17-
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
18-
# OR ((${MSVC_VERSION} GREATER_EQUAL 1910) AND ("${CMAKE_GENERATOR}" STREQUAL "Ninja"))
17+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT LSL_PRESERVE_INSTALL_PREFIX)
1918
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH
2019
"Where to put redistributable binaries" FORCE)
21-
message(WARNING "CMAKE_INSTALL_PREFIX default initialized to ${CMAKE_INSTALL_PREFIX}")
20+
message(WARNING "CMAKE_INSTALL_PREFIX default initialized to ${CMAKE_INSTALL_PREFIX}. Set LSL_PRESERVE_INSTALL_PREFIX or CMAKE_INSTALL_PREFIX to skip this.")
2221
endif()
2322

2423
# Generate folders for IDE targets (e.g., VisualStudio solutions)

0 commit comments

Comments
 (0)