Skip to content

Commit

Permalink
Fix more cmake relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Sep 26, 2021
1 parent 3b1e927 commit 91883dd
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/mexplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ project( mexplus )

# Code below is just for accessibility issues in IDE editor
# List all files (headers) contained by mexplus library
file(GLOB_RECURSE all_mexplus_files RELATIVE "${CMAKE_SOURCE_DIR}/3rdparty/mexplus" *.h *.hpp)
file(GLOB_RECURSE all_mexplus_files RELATIVE "${MRPT_SOURCE_DIR}/3rdparty/mexplus" *.h *.hpp)
# Visualize the files of this directory in IDE creating an custom empty target
add_custom_target(mexplus DEPENDS ${all_mexplus_files} SOURCES ${all_mexplus_files})
30 changes: 15 additions & 15 deletions cmakemodules/DeclareMRPTLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
#
# For code simplicity, let's use the same list, just adding the default sources there:
list(APPEND ${name}_EXTRA_SRCS
"${CMAKE_SOURCE_DIR}/libs/${name}/src/*.cpp"
"${CMAKE_SOURCE_DIR}/libs/${name}/src/*.c"
"${CMAKE_SOURCE_DIR}/libs/${name}/src/*.cxx"
"${CMAKE_SOURCE_DIR}/libs/${name}/src/*.h"
"${CMAKE_SOURCE_DIR}/libs/${name}/include/mrpt/${name}/*.h"
"${CMAKE_SOURCE_DIR}/libs/${name}/include/mrpt/${name}/*.hpp"
"${CMAKE_SOURCE_DIR}/doc/doxygen-pages/lib_mrpt_${name}.h"
"${MRPT_SOURCE_DIR}/libs/${name}/src/*.cpp"
"${MRPT_SOURCE_DIR}/libs/${name}/src/*.c"
"${MRPT_SOURCE_DIR}/libs/${name}/src/*.cxx"
"${MRPT_SOURCE_DIR}/libs/${name}/src/*.h"
"${MRPT_SOURCE_DIR}/libs/${name}/include/mrpt/${name}/*.h"
"${MRPT_SOURCE_DIR}/libs/${name}/include/mrpt/${name}/*.hpp"
"${MRPT_SOURCE_DIR}/doc/doxygen-pages/lib_mrpt_${name}.h"
)
list(APPEND ${name}_EXTRA_SRCS_NAME
"${name}"
Expand All @@ -144,7 +144,7 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
# Only add these ones for "normal" libraries:
if (NOT ${headers_only})
list(APPEND ${name}_EXTRA_SRCS
"${CMAKE_SOURCE_DIR}/libs/${name}/src/registerAllClasses.cpp"
"${MRPT_SOURCE_DIR}/libs/${name}/src/registerAllClasses.cpp"
)
list(APPEND ${name}_EXTRA_SRCS_NAME
"Class register"
Expand Down Expand Up @@ -214,8 +214,8 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
set(all_${name}_srcs ${${name}_srcs})

# Add main lib header (may not exist in meta-libs only):
if (EXISTS "${CMAKE_SOURCE_DIR}/libs/${name}/include/mrpt/${name}.h")
set(all_${name}_srcs ${all_${name}_srcs} "${CMAKE_SOURCE_DIR}/libs/${name}/include/mrpt/${name}.h")
if (EXISTS "${MRPT_SOURCE_DIR}/libs/${name}/include/mrpt/${name}.h")
set(all_${name}_srcs ${all_${name}_srcs} "${MRPT_SOURCE_DIR}/libs/${name}/include/mrpt/${name}.h")
endif ()

if (NOT ${headers_only})
Expand All @@ -227,7 +227,7 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)

# private include dirs for this lib:
target_include_directories(${name} PRIVATE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/libs/${name}/src/> # To include ${name}-precomp.h
$<BUILD_INTERFACE:${MRPT_SOURCE_DIR}/libs/${name}/src/> # To include ${name}-precomp.h
)
if(MSVC) # Define math constants if built with MSVC
target_compile_definitions(${name} PUBLIC _USE_MATH_DEFINES)
Expand Down Expand Up @@ -358,7 +358,7 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
COMPILE_FLAGS "/Yu${name}-precomp.h")

# But for the file used to build the precomp. header:
set_source_files_properties("${CMAKE_SOURCE_DIR}/libs/${name}/src/${name}-precomp.cpp"
set_source_files_properties("${MRPT_SOURCE_DIR}/libs/${name}/src/${name}-precomp.cpp"
PROPERTIES
COMPILE_FLAGS "/Yc${name}-precomp.h")
else()
Expand All @@ -371,7 +371,7 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
set_target_properties(${name} PROPERTIES
COTIRE_PREFIX_HEADER_IGNORE_PATH "${COTIRE_PREFIX_HEADER_IGNORE_PATH}"
)
set_target_properties(${name} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_SOURCE_DIR}/libs/${name}/src/${name}-precomp.h")
set_target_properties(${name} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${MRPT_SOURCE_DIR}/libs/${name}/src/${name}-precomp.h")
cotire(${name})

if($ENV{VERBOSE})
Expand All @@ -385,8 +385,8 @@ macro(internal_define_mrpt_lib name headers_only is_metalib)
endif()

source_group("Precompiled headers" FILES
"${CMAKE_SOURCE_DIR}/libs/${name}/src/${name}-precomp.cpp"
"${CMAKE_SOURCE_DIR}/libs/${name}/src/${name}-precomp.h"
"${MRPT_SOURCE_DIR}/libs/${name}/src/${name}-precomp.cpp"
"${MRPT_SOURCE_DIR}/libs/${name}/src/${name}-precomp.h"
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmakemodules/script_create_config_h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ set(MRPT_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/mrpt-configuration
file(MAKE_DIRECTORY "${MRPT_CONFIG_FILE_INCLUDE_DIR}")
file(MAKE_DIRECTORY "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt")

configure_file("${CMAKE_SOURCE_DIR}/parse-files/config.h.in" "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt/config.h")
configure_file("${MRPT_SOURCE_DIR}/parse-files/config.h.in" "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt/config.h")
2 changes: 1 addition & 1 deletion cmakemodules/script_create_version_h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if ("" STREQUAL "${CMAKE_SOURCE_DATE_EPOCH}")
endif()


configure_file("${CMAKE_SOURCE_DIR}/parse-files/version.h.in" "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt/version.h")
configure_file("${MRPT_SOURCE_DIR}/parse-files/version.h.in" "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt/version.h")


# Prepare version.rc for Windows apps:
Expand Down
8 changes: 4 additions & 4 deletions cmakemodules/script_matlab.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ endif(NOT CMAKE_MRPT_HAS_MATLAB)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Copy all .m files (classes, samples, helpers...) to the build directory
file(COPY ${CMAKE_SOURCE_DIR}/mex/+mrpt DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${CMAKE_SOURCE_DIR}/mex/samples DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${MRPT_SOURCE_DIR}/mex/+mrpt DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${MRPT_SOURCE_DIR}/mex/samples DESTINATION ${CMAKE_BINARY_DIR}/mex)
# Copy setup file and README
file(COPY ${CMAKE_SOURCE_DIR}/mex/mrpt_setup.m DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${CMAKE_SOURCE_DIR}/mex/README.txt DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${MRPT_SOURCE_DIR}/mex/mrpt_setup.m DESTINATION ${CMAKE_BINARY_DIR}/mex)
file(COPY ${MRPT_SOURCE_DIR}/mex/README.txt DESTINATION ${CMAKE_BINARY_DIR}/mex)

endif(NOT DISABLE_MATLAB)

Expand Down
8 changes: 4 additions & 4 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ project(documentation)

# Dummy documentation target for showing grouped files in IDEs:
# ----------------------------------------------------------------------------
file(GLOB_RECURSE RST_FILES "${CMAKE_SOURCE_DIR}/doc/*.rst")
file(GLOB_RECURSE MD_FILES "${CMAKE_SOURCE_DIR}/doc/*.md")
file(GLOB_RECURSE H_FILES "${CMAKE_SOURCE_DIR}/doc/sources/*.h")
file(GLOB_RECURSE RST_FILES "${MRPT_SOURCE_DIR}/doc/*.rst")
file(GLOB_RECURSE MD_FILES "${MRPT_SOURCE_DIR}/doc/*.md")
file(GLOB_RECURSE H_FILES "${MRPT_SOURCE_DIR}/doc/sources/*.h")
set(DOC_INDIV_FILES
"${CMAKE_SOURCE_DIR}/README.md"
"${MRPT_SOURCE_DIR}/README.md"
)
set(all_docs_files ${RST_FILES} ${H_FILES} ${DOC_INDIV_FILES} ${MD_FILES})
add_custom_target(DocumentationFiles DEPENDS ${all_docs_files} SOURCES ${all_docs_files})
Expand Down
2 changes: 1 addition & 1 deletion libs/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ list(APPEND math_EXTRA_SRCS_NAME "math/kmeans" "math/kmeans")

# debug visualizer for Eigen matrices
if (MSVC AND MSVC_VERSION GREATER 1800) # VS>= 2013
list(APPEND math_EXTRA_SRCS "${CMAKE_SOURCE_DIR}/debug/*.natvis")
list(APPEND math_EXTRA_SRCS "${MRPT_SOURCE_DIR}/debug/*.natvis")
list(APPEND math_EXTRA_SRCS_NAME "MSVC debug natvis")
endif()

Expand Down
2 changes: 1 addition & 1 deletion libs/system/include/mrpt/system/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::string getcwd();
/** Attempts to find the directory `[PREFIX/]share/mrpt/` and returns its
* absolute path, or empty string if not found.
* Example return paths: Linux after installing = `/usr/share/mrpt/`;
* manually-built system = `[CMAKE_SOURCE_DIR]/share/mrpt/`, etc. */
* manually-built system = `[MRPT_SOURCE_DIR]/share/mrpt/`, etc. */
std::string getShareMRPTDir();

/** Creates a directory
Expand Down
2 changes: 1 addition & 1 deletion parse-files/mrpt_paths_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

#pragma once

#define MRPT_SOURCE_BASE_DIRECTORY "${CMAKE_SOURCE_DIR}"
#define MRPT_SOURCE_BASE_DIRECTORY "${MRPT_SOURCE_DIR}"
#define MRPT_INSTALL_PREFIX_DIRECTORY "${CMAKE_INSTALL_PREFIX}"

2 changes: 1 addition & 1 deletion parse-files/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const char MRPT_version_str[] = "${CMAKE_MRPT_COMPLETE_NAME}";
// See specs: https://reproducible-builds.org/specs/source-date-epoch/
const char MRPT_SOURCE_DATE_EPOCH[] = "${CMAKE_SOURCE_DATE_EPOCH}";

const char MRPT_CMAKE_SOURCE_DIR[] = "${CMAKE_SOURCE_DIR}";
const char MRPT_CMAKE_SOURCE_DIR[] = "${MRPT_SOURCE_DIR}";
const char MRPT_CMAKE_INSTALL_PREFIX[] = "${CMAKE_INSTALL_PREFIX}";

#endif

0 comments on commit 91883dd

Please sign in to comment.