CMake: Allow specifying custom LIBDIR on Unix
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2018 14:15:54 +0000 (16:15 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2018 14:15:54 +0000 (16:15 +0200)
Works similar to how maxOS deals with this.

build_files/cmake/platform/platform_unix.cmake

index 43a06c673739275df5d65abcb56ce9b1934d5059..bc6ebeab97c4ffe4c71426feaa4b7f8eb865d0c2 100644 (file)
 # Libraries configuration for any *nix system including Linux and Unix.
 
 # Detect precompiled library directory
-set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
-string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
-set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
+if(NOT DEFINED LIBDIR)
+       set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
+       string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
+       set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
+else()
+       message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
+endif()
 
 if(EXISTS ${LIBDIR})
        file(GLOB LIB_SUBDIRS ${LIBDIR}/*)