Skip to content

Commit

Permalink
cmake: set skip rpath on build stage, add easy install wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross authored and eagleivg committed Oct 3, 2018
1 parent 1bf9d60 commit de200eb
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,54 @@ project(OpenXRay)
include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
if(NOT WIN32)
set(CMAKE_INSTALL_PREFIX "") # Skip all *nix-style installing for a while. Use DESTDIR
endif()

include(cotire)

function(xr_install tgt)
if(NOT MSVC)
install(TARGETS ${tgt} DESTINATION "."
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE) # chmod 755
else()
install(TARGETS ${tgt}
CONFIGURATIONS Debug
RUNTIME DESTINATION Debug/
LIBRARY DESTINATION Debug/)
install(FILES $<TARGET_PDB_FILE:${tgt}>
CONFIGURATIONS Debug
DESTINATION Debug/ )
install(TARGETS ${tgt}
CONFIGURATIONS Release
RUNTIME DESTINATION Release/
LIBRARY DESTINATION Release/)
endif()
endfunction()

# Use only if install defined outside target directory(like luabind, for example)
function(xr_install_file tgt)
if(NOT MSVC)
install(FILES $<TARGET_FILE:${tgt}> DESTINATION "."
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE) # chmod 755
else()
install($<TARGET_FILE:${tgt}>
CONFIGURATIONS Debug
RUNTIME DESTINATION Debug/)
install(FILES $<TARGET_PDB_FILE:${tgt}>
CONFIGURATIONS Debug
DESTINATION Debug/ )
install($<TARGET_FILE:${tgt}>
CONFIGURATIONS Release
RUNTIME DESTINATION Release/)
endif()
endfunction()

find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
Expand Down

0 comments on commit de200eb

Please sign in to comment.