osx: for cmake set library output to be lib folder

On Apple only set  CMAKE_LIBRARY_OUTPUT_DIRECTORY to be “lib” folder instead of “bin” folder
Fixes osx problem when launching renderdoccmd not being able to find librenderdoc.dylib
RPATH is set to be "@executable_path/../lib" which matches where qrenderdoc.app copies the renderdoc library to

qrenderdoc: set library search folder “-L” to be CMAKE_LIBRARY_OUTPUT_DIRECTORY instead of CMAKE_RUNTIME_OUTPUT_DIRECTORY
This commit is contained in:
Jake Turner
2018-12-31 19:43:30 +13:00
committed by Baldur Karlsson
parent 8fdf3ac245
commit 8105ddb5ab
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -165,7 +165,11 @@ if(ANDROID)
message(STATUS "Using Android native API level ${ANDROID_NATIVE_API_LEVEL}")
endif()
if(APPLE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if(ENABLE_GL)
+1 -1
View File
@@ -124,7 +124,7 @@ file(WRITE
"LIB_SUBFOLDER_TRAIL_SLASH=${LIB_SUBFOLDER_TRAIL_SLASH}\n"
"\n"
# search for -lrenderdoc here
"LIBS+=-L${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\n"
"LIBS+=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\n"
"\n"
# include and link against python
"INCLUDEPATH+=${PYTHON_INCLUDE_DIR}\n"
+1 -1
View File
@@ -139,7 +139,7 @@ win32 {
DEFINES += RENDERDOC_PLATFORM_POSIX RENDERDOC_PLATFORM_APPLE
ICON = $$OSX_ICONFILE
librd.files = $$files($$DESTDIR/librenderdoc.dylib)
librd.files = $$files($$DESTDIR/../lib/librenderdoc.dylib)
librd.path = Contents/lib
QMAKE_BUNDLE_DATA += librd