Commit 0d8149ef authored by Patrik Huber's avatar Patrik Huber

Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR

Otherwise, when another project includes eos via add_subdirectory(), these paths will refer to the top-level CMakeLists, not this one from eos.
parent 542a2d2e
...@@ -50,16 +50,16 @@ endif() ...@@ -50,16 +50,16 @@ endif()
find_package(Boost 1.50.0 COMPONENTS system REQUIRED) find_package(Boost 1.50.0 COMPONENTS system REQUIRED)
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}") message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
message(STATUS "Eigen3 found: ${EIGEN3_FOUND}, version: ${EIGEN3_VERSION}") message(STATUS "Eigen3 found: ${EIGEN3_FOUND}, version: ${EIGEN3_VERSION}")
message(STATUS "Eigen3 include dir found at ${EIGEN3_INCLUDE_DIR}") message(STATUS "Eigen3 include dir found at ${EIGEN3_INCLUDE_DIR}")
# Set the include directories of the 3rd-party submodules that we use: # Set the include directories of the 3rd-party submodules that we use:
set(CEREAL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/cereal-1.1.1/include") set(CEREAL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cereal-1.1.1/include")
set(glm_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/glm") set(glm_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glm")
set(nanoflann_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/nanoflann/include") set(nanoflann_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanoflann/include")
set(eigen3_nnls_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/eigen3-nnls/src") set(eigen3_nnls_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/eigen3-nnls/src")
# Header files of the eos library: # Header files of the eos library:
set(HEADERS set(HEADERS
...@@ -125,16 +125,16 @@ source_group(render\\detail REGULAR_EXPRESSION include/eos/render/detail/*) ...@@ -125,16 +125,16 @@ source_group(render\\detail REGULAR_EXPRESSION include/eos/render/detail/*)
source_group(video REGULAR_EXPRESSION include/eos/video/*) source_group(video REGULAR_EXPRESSION include/eos/video/*)
# The eos install target: # The eos install target:
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) # our library headers install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include) # our library headers
install(DIRECTORY ${CMAKE_SOURCE_DIR}/share/ DESTINATION share) # the model and metadata install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/ DESTINATION share) # the model and metadata
# For 3rd party headers, we only copy the headers and licence files: # For 3rd party headers, we only copy the headers and licence files:
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/cereal-1.1.1/ DESTINATION 3rdparty/cereal-1.1.1) # cereal headers install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cereal-1.1.1/ DESTINATION 3rdparty/cereal-1.1.1) # cereal headers
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/glm/glm/ DESTINATION 3rdparty/glm/glm) # glm headers install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glm/glm/ DESTINATION 3rdparty/glm/glm) # glm headers
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/glm/copying.txt DESTINATION 3rdparty/glm/) # glm licence install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glm/copying.txt DESTINATION 3rdparty/glm/) # glm licence
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/nanoflann/include/ DESTINATION 3rdparty/nanoflann/include) # nanoflann header install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanoflann/include/ DESTINATION 3rdparty/nanoflann/include) # nanoflann header
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/nanoflann/COPYING DESTINATION 3rdparty/nanoflann/) # nanoflann licence install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanoflann/COPYING DESTINATION 3rdparty/nanoflann/) # nanoflann licence
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/eigen3-nnls/src/ DESTINATION 3rdparty/eigen3-nnls/src) # eigen3-nnls header install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/eigen3-nnls/src/ DESTINATION 3rdparty/eigen3-nnls/src) # eigen3-nnls header
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/eigen3-nnls/README.md DESTINATION 3rdparty/eigen3-nnls/) # eigen3-nnls attribution install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/eigen3-nnls/README.md DESTINATION 3rdparty/eigen3-nnls/) # eigen3-nnls attribution
if(EOS_BUILD_EXAMPLES) if(EOS_BUILD_EXAMPLES)
add_subdirectory(examples) add_subdirectory(examples)
...@@ -153,12 +153,12 @@ if(EOS_GENERATE_PYTHON_BINDINGS) ...@@ -153,12 +153,12 @@ if(EOS_GENERATE_PYTHON_BINDINGS)
# If this fails, the repo has probably not been cloned with submodules. Run: git submodule update --init # If this fails, the repo has probably not been cloned with submodules. Run: git submodule update --init
add_subdirectory(${PYBIND11_PATH}) # add and initialise pybind11 add_subdirectory(${PYBIND11_PATH}) # add and initialise pybind11
add_subdirectory(python) # the actual bindings add_subdirectory(python) # the actual bindings
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/pybind11/include/ DESTINATION 3rdparty/pybind11/include) # pybind11 headers install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/pybind11/include/ DESTINATION 3rdparty/pybind11/include) # pybind11 headers
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/pybind11/LICENSE DESTINATION 3rdparty/pybind11/) # pybind11 licence install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/pybind11/LICENSE DESTINATION 3rdparty/pybind11/) # pybind11 licence
endif() endif()
if(EOS_GENERATE_MATLAB_BINDINGS) if(EOS_GENERATE_MATLAB_BINDINGS)
add_subdirectory(matlab) add_subdirectory(matlab)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/mexplus/include/ DESTINATION 3rdparty/mexplus/include) # mexplus headers install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mexplus/include/ DESTINATION 3rdparty/mexplus/include) # mexplus headers
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/mexplus/LICENSE DESTINATION 3rdparty/mexplus/) # mexplus licence install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mexplus/LICENSE DESTINATION 3rdparty/mexplus/) # mexplus licence
endif() endif()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment