Skip to content

Commit 86e36e8

Browse files
hansfnrichiware
authored andcommitted
Install config files in correct location (#51)
* Install config files in correct location According to https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure the config files should be *not* placed under /usr/share (which is what DATA_INSTALL_DIR gives you). Putting it one location under /usr/share makes it impossible to install for multiple libs (or archs). The provided patch is only tested under Linux and might need extension to work under Windows. (See link abode for Windows search path.) * Changing to lib/cmake/${projectname} Co-Authored-By: Ricardo González <[email protected]> * Updated Windows packaging cmake template with new config directory.
1 parent 4fc79bf commit 86e36e8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmake/packaging/windows/fastcdr-config.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
if(MSVC_VERSION EQUAL 1900)
1616
if(CMAKE_CL_64)
17-
include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-x64Win64VS2015/cmake/fastcdr-config.cmake")
17+
include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-x64Win64VS2015/fastcdr-config.cmake")
1818
else()
19-
include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-i86Win32VS2015/cmake/fastcdr-config.cmake")
19+
include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-i86Win32VS2015/fastcdr-config.cmake")
2020
endif()
2121
elseif(MSVC_VERSION GREATER 1900)
2222
if(CMAKE_CL_64)
23-
include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-x64Win64VS2017/cmake/fastcdr-config.cmake")
23+
include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-x64Win64VS2017/fastcdr-config.cmake")
2424
else()
25-
include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-i86Win32VS2017/cmake/fastcdr-config.cmake")
25+
include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-i86Win32VS2017/fastcdr-config.cmake")
2626
endif()
2727
else()
2828
message(FATAL_ERROR "Not supported version of Visual Studio")

src/cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if(MSVC OR MSVC_IDE AND EPROSIMA_INSTALLER)
137137
endif()
138138

139139
install(FILES ${PROJECT_SOURCE_DIR}/cmake/packaging/windows/${PROJECT_NAME}-config.cmake
140-
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/cmake
140+
DESTINATION ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}${MSVCARCH_DIR_EXTENSION_EXT}
141141
COMPONENT cmake
142142
)
143143
elseif(NOT EPROSIMA_INSTALLER)
@@ -154,7 +154,7 @@ elseif(NOT EPROSIMA_INSTALLER)
154154
if(INSTALLER_PLATFORM)
155155
set(INSTALL_DESTINATION_PATH ${DATA_INSTALL_DIR}/${PROJECT_NAME}-${INSTALLER_PLATFORM}/cmake)
156156
else()
157-
set(INSTALL_DESTINATION_PATH ${DATA_INSTALL_DIR}/${PROJECT_NAME}/cmake${MSVCARCH_DIR_EXTENSION_EXT})
157+
set(INSTALL_DESTINATION_PATH ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}${MSVCARCH_DIR_EXTENSION_EXT})
158158
endif()
159159

160160
install(EXPORT ${PROJECT_NAME}-targets

0 commit comments

Comments
 (0)