Skip to content

Commit

Permalink
COMP: Fix hardcoded path in RTK install
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGandel committed Jul 21, 2021
1 parent 4d288a5 commit 42f0c5f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,9 @@ list(APPEND RTK_INCLUDE_DIRS
list(APPEND RTK_INCLUDE_DIRS
${RTK_BINARY_DIR})

# Export library linking directories (used by LIBPATH)
set(RTK_SYSTEM_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(RTK_SYSTEM_INCLUDE_DIRS ${RTK_INCLUDE_DIRS})

#=========================================================
# Generate RTKConfig.cmake for the build tree.
set(RTK_MODULE_PATH_CONFIG ${CMAKE_MODULE_PATH})
set(RTK_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

set(RTK_EXPORT_CODE_BUILD "
# The RTK version number
Expand Down Expand Up @@ -233,6 +228,11 @@ if(NOT ITK_SOURCE_DIR)

list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
include(ITKModuleExternal)

# Add third party to RTK build targets.
# This must be done after RTK has been loaded by ITK to make sure
# ${itk-module} variables are defined for RTK.
itk_module_target_export(lpsolve55)
else()
itk_module_impl()
endif()
Expand Down
2 changes: 1 addition & 1 deletion itk-module-init.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Find the packages required by this module
#
list(APPEND CMAKE_MODULE_PATH ${RTK_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

include(CheckLanguage)
check_language(CUDA)
Expand Down
20 changes: 12 additions & 8 deletions utilities/lp_solve/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,25 @@ set_target_properties(lpsolve55 PROPERTIES VERSION ${LPSOLVE_VERSION}
SOVERSION ${LPSOLVE_VERSION_MAJOR})

if (NOT ITK_SOURCE_DIR)
# TODO: export target to find_package(RTK) on build directory ?
# Export to RTK build targets must be done after RTK has been loaded by ITK.
# When building externally we must do this after including ITKModuleExternal.
# See RTK/CMakeLists.txt.
else()
itk_module_target_export(lpsolve55)
endif()

#=========================================================
if(NOT RTK_INSTALL_NO_LIBRARIES)
target_include_directories(lpsolve55 PUBLIC $<INSTALL_INTERFACE:${RTK_INSTALL_INCLUDE_DIR}/lpsolve>)
install(TARGETS lpsolve55 EXPORT RTK
RUNTIME DESTINATION ${RTK_INSTALL_RUNTIME_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${RTK_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${RTK_INSTALL_ARCHIVE_DIR} COMPONENT Development
PUBLIC_HEADER DESTINATION "${RTK_INSTALL_INCLUDE_DIR}/lpsolve"
)
install(TARGETS lpsolve55 EXPORT ITKTargets

# External modules use their own targets.
set(_install_targets RTKTargets)
if(ITK_SOURCE_DIR)
# Remote modules use ITKTargets.cmake
set(_install_targets ITKTargets)
endif()

install(TARGETS lpsolve55 EXPORT ${_install_targets}
RUNTIME DESTINATION ${RTK_INSTALL_RUNTIME_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${RTK_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${RTK_INSTALL_ARCHIVE_DIR} COMPONENT Development
Expand Down

0 comments on commit 42f0c5f

Please sign in to comment.