Skip to content

Commit

Permalink
Rename LSL_ROOT to LSL_INSTALL_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
tstenner committed Nov 10, 2017
1 parent 8e20cd0 commit 11d0252
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 39 deletions.
9 changes: 6 additions & 3 deletions Apps/BrainProducts/BrainAmpSeries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ project(BrainAmpSeries

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
if(NOT LSL_INSTALL_ROOT)
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)")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

Expand Down
11 changes: 7 additions & 4 deletions Apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ cmake_minimum_required(VERSION 3.5)
# target_compile_features()
set(CMAKE_CXX_STANDARD 11)

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

Expand Down
9 changes: 6 additions & 3 deletions Apps/LabRecorder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ project(LabRecorder

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
if(NOT LSL_INSTALL_ROOT)
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)")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

Expand Down
17 changes: 10 additions & 7 deletions Apps/OpenVR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ project(LSLOpenVR VERSION 0.0.1)

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
set(LSL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../build/lsl_Release/lslinstall/LSL")
get_filename_component(LSL_ROOT ${LSL_ROOT} ABSOLUTE)
if(NOT EXISTS ${LSL_ROOT})
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
if(NOT LSL_INSTALL_ROOT)
set(LSL_INSTALL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../build/lsl_Release/lslinstall/LSL")
get_filename_component(LSL_INSTALL_ROOT ${LSL_INSTALL_ROOT} ABSOLUTE)
if(NOT EXISTS ${LSL_INSTALL_ROOT})
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)")
endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

set(CMAKE_INSTALL_PREFIX ${LSL_ROOT}/..)
set(CMAKE_INSTALL_PREFIX ${LSL_INSTALL_ROOT}/..)

set(CMAKE_CXX_STANDARD 11)

Expand Down
11 changes: 7 additions & 4 deletions Apps/Wiimote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ project(Wiimote

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
if(NOT LSL_INSTALL_ROOT)
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)")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

set(CMAKE_INSTALL_PREFIX ${LSL_ROOT}/..)
set(CMAKE_INSTALL_PREFIX ${LSL_INSTALL_ROOT}/..)

# GENERAL CONFIG #

Expand Down
9 changes: 6 additions & 3 deletions Apps/XDFBrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ project(XDFBrowser

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
if(NOT LSL_INSTALL_ROOT)
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)")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

Expand Down
19 changes: 11 additions & 8 deletions Apps/g.Tec/g.NEEDaccess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ project(gNEEDaccess VERSION 0.0.1)

# load LSLAppBoilerplate if not done already
if(NOT TARGET LSL::lsl)
if(NOT LSL_ROOT)
# If building the app out of tree, the user is expected to supply LSL_ROOT.
if(NOT LSL_INSTALL_ROOT)
# If building the app out of tree, the user is expected to supply LSL_INSTALL_ROOT.
# For ease of Chadwick Boulay's development, he has added a default directory to check.
# This default directory is probably wrong for you. Ignore it.
# Just supply -DLSL_ROOT=/path/to/installed/lsl to the cmake command.
set(LSL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../build/lsl_Release/lslinstall/LSL")
get_filename_component(LSL_ROOT ${LSL_ROOT} ABSOLUTE)
if(NOT EXISTS ${LSL_ROOT})
message(FATAL_ERROR "When building a single app out of tree you need to set LSL_ROOT ( cmake -DLSL_ROOT=/path/to/installed/lsl)")
# Just supply -DLSL_INSTALL_ROOT=/path/to/installed/lsl to the cmake command.
set(LSL_INSTALL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../build/lsl_Release/lslinstall/LSL")
get_filename_component(LSL_INSTALL_ROOT ${LSL_INSTALL_ROOT} ABSOLUTE)
if(NOT EXISTS ${LSL_INSTALL_ROOT})
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)")
endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake")
if(NOT IS_ABSOLUTE ${LSL_INSTALL_ROOT})
message(FATAL_ERROR "LSL_INSTALL_ROOT needs to be an absolute path")
endif()
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake")
include(LSLAppBoilerplate)
endif()

Expand Down
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ endif()
add_subdirectory(LSL/liblsl)


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

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

# load settings for all LSL Apps
list(APPEND CMAKE_MODULE_PATH "${LSL_ROOT}/cmake/")
list(APPEND CMAKE_MODULE_PATH "${LSL_INSTALL_ROOT}/cmake/")
include(LSLAppBoilerplate)

# include the Apps directory which defines options, which Apps will be built
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ unless you know what you're doing.

To import the LSL library in a separate CMake build, you need to set the the
**absolute path** to the['installed' LSL directory](#install-directory-tree)
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
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
of the ['installed' LSL directory](#install-directory-tree) to your `CMAKE_PREFIX_PATH`.

0 comments on commit 11d0252

Please sign in to comment.