Skip to content

Commit 11d0252

Browse files
committed
Rename LSL_ROOT to LSL_INSTALL_ROOT
1 parent 8e20cd0 commit 11d0252

File tree

9 files changed

+61
-39
lines changed

9 files changed

+61
-39
lines changed

Apps/BrainProducts/BrainAmpSeries/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ project(BrainAmpSeries
55

66
# load LSLAppBoilerplate if not done already
77
if(NOT TARGET LSL::lsl)
8-
if(NOT LSL_ROOT)
9-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
8+
if(NOT LSL_INSTALL_ROOT)
9+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1010
endif()
11-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
11+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
12+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
13+
endif()
14+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1215
include(LSLAppBoilerplate)
1316
endif()
1417

Apps/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ cmake_minimum_required(VERSION 3.5)
44
# target_compile_features()
55
set(CMAKE_CXX_STANDARD 11)
66

7-
# when building out of tree LSL_ROOT needs to be specified on the cmd line
8-
if(NOT LSL_ROOT)
9-
message(FATAL_ERROR "When building out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/lsl/installation)")
7+
# when building out of tree LSL_INSTALL_ROOT needs to be specified on the cmd line
8+
if(NOT LSL_INSTALL_ROOT)
9+
message(FATAL_ERROR "When building out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/lsl/installation)")
1010
else()
11-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
11+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
12+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
13+
endif()
14+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1215
include(LSLAppBoilerplate)
1316
endif()
1417

Apps/LabRecorder/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ project(LabRecorder
77

88
# load LSLAppBoilerplate if not done already
99
if(NOT TARGET LSL::lsl)
10-
if(NOT LSL_ROOT)
11-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
10+
if(NOT LSL_INSTALL_ROOT)
11+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1212
endif()
13-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
13+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
14+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
15+
endif()
16+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1417
include(LSLAppBoilerplate)
1518
endif()
1619

Apps/OpenVR/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ project(LSLOpenVR VERSION 0.0.1)
55

66
# load LSLAppBoilerplate if not done already
77
if(NOT TARGET LSL::lsl)
8-
if(NOT LSL_ROOT)
9-
set(LSL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../build/lsl_Release/lslinstall/LSL")
10-
get_filename_component(LSL_ROOT ${LSL_ROOT} ABSOLUTE)
11-
if(NOT EXISTS ${LSL_ROOT})
12-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
8+
if(NOT LSL_INSTALL_ROOT)
9+
set(LSL_INSTALL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../build/lsl_Release/lslinstall/LSL")
10+
get_filename_component(LSL_INSTALL_ROOT ${LSL_INSTALL_ROOT} ABSOLUTE)
11+
if(NOT EXISTS ${LSL_INSTALL_ROOT})
12+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1313
endif()
1414
endif()
15-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
15+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
16+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
17+
endif()
18+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1619
include(LSLAppBoilerplate)
1720
endif()
1821

19-
set(CMAKE_INSTALL_PREFIX ${LSL_ROOT}/..)
22+
set(CMAKE_INSTALL_PREFIX ${LSL_INSTALL_ROOT}/..)
2023

2124
set(CMAKE_CXX_STANDARD 11)
2225

Apps/Wiimote/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ project(Wiimote
77

88
# load LSLAppBoilerplate if not done already
99
if(NOT TARGET LSL::lsl)
10-
if(NOT LSL_ROOT)
11-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
10+
if(NOT LSL_INSTALL_ROOT)
11+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1212
endif()
13-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
13+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
14+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
15+
endif()
16+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1417
include(LSLAppBoilerplate)
1518
endif()
1619

17-
set(CMAKE_INSTALL_PREFIX ${LSL_ROOT}/..)
20+
set(CMAKE_INSTALL_PREFIX ${LSL_INSTALL_ROOT}/..)
1821

1922
# GENERAL CONFIG #
2023

Apps/XDFBrowser/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ project(XDFBrowser
55

66
# load LSLAppBoilerplate if not done already
77
if(NOT TARGET LSL::lsl)
8-
if(NOT LSL_ROOT)
9-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
8+
if(NOT LSL_INSTALL_ROOT)
9+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1010
endif()
11-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
11+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
12+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
13+
endif()
14+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1215
include(LSLAppBoilerplate)
1316
endif()
1417

Apps/g.Tec/g.NEEDaccess/CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ project(gNEEDaccess VERSION 0.0.1)
33

44
# load LSLAppBoilerplate if not done already
55
if(NOT TARGET LSL::lsl)
6-
if(NOT LSL_ROOT)
7-
# If building the app out of tree, the user is expected to supply LSL_ROOT.
6+
if(NOT LSL_INSTALL_ROOT)
7+
# If building the app out of tree, the user is expected to supply LSL_INSTALL_ROOT.
88
# For ease of Chadwick Boulay's development, he has added a default directory to check.
99
# This default directory is probably wrong for you. Ignore it.
10-
# Just supply -DLSL_ROOT=/path/to/installed/lsl to the cmake command.
11-
set(LSL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../build/lsl_Release/lslinstall/LSL")
12-
get_filename_component(LSL_ROOT ${LSL_ROOT} ABSOLUTE)
13-
if(NOT EXISTS ${LSL_ROOT})
14-
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
10+
# Just supply -DLSL_INSTALL_ROOT=/path/to/installed/lsl to the cmake command.
11+
set(LSL_INSTALL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../build/lsl_Release/lslinstall/LSL")
12+
get_filename_component(LSL_INSTALL_ROOT ${LSL_INSTALL_ROOT} ABSOLUTE)
13+
if(NOT EXISTS ${LSL_INSTALL_ROOT})
14+
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_INSTALL_ROOT ( cmake -DLSL_INSTALL_ROOT=/path/to/installed/lsl)")
1515
endif()
1616
endif()
17-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
17+
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
18+
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
19+
endif()
20+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
1821
include(LSLAppBoilerplate)
1922
endif()
2023

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ endif()
1414
add_subdirectory(LSL/liblsl)
1515

1616

17-
# When building the whole tree, we define LSL_ROOT as the current directory.
17+
# When building the whole tree, we define LSL_INSTALL_ROOT as the current directory.
1818
# In this case we have liblsl as an actual target, so we don't need to find it.
19-
set(LSL_ROOT ${CMAKE_CURRENT_LIST_DIR} CACHE STRING
20-
"LSL root directory, LSL_ROOT/cmake contains modules to set everything up / find liblsl" FORCE)
19+
# In all other cases, LSL_INSTALL_ROOT must be set to an actual **installed** lsl root.
20+
set(LSL_INSTALL_ROOT ${CMAKE_CURRENT_LIST_DIR} CACHE STRING
21+
"LSL root directory, LSL_INSTALL_ROOT/cmake contains modules to set everything up / find liblsl" FORCE)
2122

2223
# When using a precompiled lsl, liblsl is installed as an exported target with
23-
# an autogenerated FindLSL.cmake in LSL_ROOT/cmake so the apps and
24-
# LSLAppBoilerplate don't care where LSL_ROOT was defined
24+
# an autogenerated FindLSL.cmake in LSL_INSTALL_ROOT/cmake so the apps and
25+
# LSLAppBoilerplate don't care where LSL_INSTALL_ROOT was defined
2526

2627
# load settings for all LSL Apps
27-
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake/")
28+
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake/")
2829
include(LSLAppBoilerplate)
2930

3031
# include the Apps directory which defines options, which Apps will be built

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ unless you know what you're doing.
147147

148148
To import the LSL library in a separate CMake build, you need to set the the
149149
**absolute path** to the['installed' LSL directory](#install-directory-tree)
150-
in the `LSL_ROOT` variable (e.g. `-DLSL_ROOT=C:/LSL/build/install/lsl_Release/LSL`) or add the **absolute path** to the`LSL/cmake` subfolder
150+
in the `LSL_INSTALL_ROOT` variable (e.g. `-DLSL_INSTALL_ROOT=C:/LSL/build/install/lsl_Release/LSL`) or add the **absolute path** to the`LSL/cmake` subfolder
151151
of the ['installed' LSL directory](#install-directory-tree) to your `CMAKE_PREFIX_PATH`.

0 commit comments

Comments
 (0)