void-packages/srcpkgs/ericw-tools/patches/cmake-light.diff

71 lines
3.0 KiB
Diff
Raw Normal View History

2019-10-30 07:55:49 -07:00
--- light/CMakeLists.txt.orig 2019-03-25 22:56:31.000000000 -0400
+++ light/CMakeLists.txt 2019-10-30 10:34:54.952515183 -0400
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 2.8)
-project (light CXX)
+project (ericw-light CXX)
set(LIGHT_INCLUDES
${CMAKE_SOURCE_DIR}/include/light/imglib.hh
@@ -49,18 +49,13 @@
trace_embree.cc
${CMAKE_SOURCE_DIR}/include/light/trace_embree.hh
${LIGHT_SOURCES})
-
- # This needs to be before the add_executable
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- SET(CMAKE_INSTALL_RPATH "$ORIGIN")
- endif ()
endif(embree_FOUND)
-add_executable(light ${LIGHT_SOURCES} main.cc)
-target_link_libraries (light ${CMAKE_THREAD_LIBS_INIT})
+add_executable(ericw-light ${LIGHT_SOURCES} main.cc)
+target_link_libraries (ericw-light ${CMAKE_THREAD_LIBS_INIT})
if (embree_FOUND)
- target_link_libraries (light ${EMBREE_LIBRARY})
+ target_link_libraries (ericw-light ${EMBREE_LIBRARY})
add_definitions(-DHAVE_EMBREE)
set(EMBREE_LICENSE "${embree_DIR}/doc/LICENSE.txt")
@@ -68,10 +63,10 @@
if(WIN32)
file(GLOB EMBREE_DLLS "${embree_DIR}/bin/*.dll")
foreach(EMBREE_DLL ${EMBREE_DLLS})
- add_custom_command(TARGET light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_DLL} $<TARGET_FILE_DIR:light>)
+ add_custom_command(TARGET ericw-light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_DLL} $<TARGET_FILE_DIR:ericw-light>)
endforeach(EMBREE_DLL)
- add_custom_command(TARGET light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_LICENSE} $<TARGET_FILE_DIR:light>/LICENSE-embree.txt)
+ add_custom_command(TARGET ericw-light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_LICENSE} $<TARGET_FILE_DIR:ericw-light>/LICENSE-embree.txt)
install(FILES ${EMBREE_DLLS} DESTINATION bin)
endif()
@@ -96,22 +91,17 @@
foreach(EMBREE_DYLIB ${EMBREE_DYLIBS})
message(STATUS "Copying dylib: ${EMBREE_DYLIB}")
- add_custom_command(TARGET light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_DYLIB} $<TARGET_FILE_DIR:light>)
+ add_custom_command(TARGET ericw-light POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${EMBREE_DYLIB} $<TARGET_FILE_DIR:ericw-light>)
endforeach()
# so the executable will search for dylib's in the same directory as the executable
if(APPLE)
- add_custom_command(TARGET light POST_BUILD COMMAND bash ARGS -c \"install_name_tool -add_rpath @loader_path $<TARGET_FILE:light> || true\")
+ add_custom_command(TARGET ericw-light POST_BUILD COMMAND bash ARGS -c \"install_name_tool -add_rpath @loader_path $<TARGET_FILE:ericw-light> || true\")
endif()
-
- install(FILES ${EMBREE_DYLIBS} DESTINATION bin)
endif()
-
- install(FILES ${EMBREE_LICENSE} DESTINATION bin RENAME LICENSE-embree.txt)
endif(embree_FOUND)
-install(TARGETS light RUNTIME DESTINATION bin)
-install(FILES ${CMAKE_SOURCE_DIR}/gpl_v3.txt DESTINATION bin)
+install(TARGETS ericw-light RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# test