Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #532 from lr-morales/libs/resourcelocator/485-cmak…
Browse files Browse the repository at this point in the history
…e_paths

[Issue #485] Refactor resourcelocator to use CMAKE_INSTALL_PREFIX
  • Loading branch information
fqez authored Sep 15, 2016
2 parents 8345ba4 + f1a7aaf commit e5c3448
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/src)
# #
###################

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/interfaces/libJderobotInterfaces.so DESTINATION ${CMAKE_INSTALL_PREFIX}/jderobot COMPONENT core)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/interfaces/libJderobotInterfaces.so DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/jderobot COMPONENT core)

# Install python files
FILE(GLOB_RECURSE HEADERS_FILES ${CMAKE_CURRENT_BINARY_DIR}/src/interfaces/python/*py)
Expand Down Expand Up @@ -187,7 +187,7 @@ ENDFOREACH(currentBin)

FOREACH (currentBin ${LIST_TOOLS})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/tools/${currentBin}/${currentBin})
INSTALL (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/toolss/${currentBin}/${currentBin} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin OPTIONAL COMPONENT core)
INSTALL (PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/src/tools/${currentBin}/${currentBin} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin OPTIONAL COMPONENT core)
else()
INSTALL (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/src/tools/${currentBin}/${currentBin} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin OPTIONAL COMPONENT core)
endif()
Expand Down
11 changes: 9 additions & 2 deletions src/libs/resourcelocator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@ list(APPEND LIBRARIES)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
)

configure_file(
include/resourcelocator/gladelocator.hpp.in
include/resourcelocator/gladelocator.hpp
@ONLY
)

## Sources
set(SOURCES
include/resourcelocator/stdutils.hpp
include/resourcelocator/resourcelocator.hpp
include/resourcelocator/gladelocator.hpp
${CMAKE_CURRENT_BINARY_DIR}/include/resourcelocator/gladelocator.hpp

src/resourcelocator.cpp
)
Expand All @@ -34,7 +41,7 @@ target_link_libraries(${binname} ${LIBRARIES})
## Options
set_target_properties(${binname} PROPERTIES COMPILE_FLAGS "-Wall -Wextra")

set(${binname}_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE PATH "Find(${binname})")
set(${binname}_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_CURRENT_BINARY_DIR}/include" CACHE PATH "Find(${binname})")
set(${binname}_LIBRARY_DIRS "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "Find(${binname})")
set(${binname}_LIBRARIES "${binname}" CACHE STRINGS "Find(${binname})")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace resourcelocator {

std::string
inline findGladeFile(const std::string filename)
{ return findFile(filename, "GLADE_PATH", "/usr/local/share/jderobot/glade"); }
{ return findFile(filename, "GLADE_PATH", "@CMAKE_INSTALL_PREFIX@/share/jderobot/glade"); }


}//NS
Expand Down

0 comments on commit e5c3448

Please sign in to comment.