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

Commit

Permalink
[Issue #485] Refactor resourcelocator to use CMAKE_INSTALL_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
lr-morales committed Jul 30, 2016
1 parent 38fabf0 commit 5a1f2d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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 5a1f2d1

Please sign in to comment.