| 1 | # - ow_add_private_library_dirs(dir1 ... dirN) |
|---|
| 2 | # Adds private link directories (directories in which to search for libraries |
|---|
| 3 | # e.g library path) to the current project |
|---|
| 4 | # |
|---|
| 5 | # Specifies the paths in which the linker should search for libraries |
|---|
| 6 | # |
|---|
| 7 | # Term 'private' means that link directories will be |
|---|
| 8 | # automatically used inside inherited projects |
|---|
| 9 | # See ow_add_public_library_dirs() for the 'public' version of this function |
|---|
| 10 | # |
|---|
| 11 | # GNU GCC Options for Directory Search: http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Directory-Options.html |
|---|
| 12 | # Microsoft Visual C++ Additional Libpath: http://msdn2.microsoft.com/en-us/library/1xhzskbe.aspx |
|---|
| 13 | # |
|---|
| 14 | # Example: |
|---|
| 15 | # ow_create_executable(mytest) |
|---|
| 16 | # |
|---|
| 17 | # ow_add_private_libraries( |
|---|
| 18 | # #Path to FFmpeg library |
|---|
| 19 | # /path/to/libavcodec |
|---|
| 20 | # ) |
|---|
| 21 | # |
|---|
| 22 | # ow_add_private_libraries( |
|---|
| 23 | # #FFmpeg library |
|---|
| 24 | # libavcodec.a |
|---|
| 25 | # ) |
|---|
| 26 | # |
|---|
| 27 | # ow_add_sources( |
|---|
| 28 | # mytest.c |
|---|
| 29 | # ) |
|---|
| 30 | # |
|---|
| 31 | # ow_create_project_binary() |
|---|
| 32 | # |
|---|
| 33 | # Output produced: |
|---|
| 34 | # gcc -L/path/to/libavcodec mytest.c -lavcodec -o mytest |
|---|
| 35 | # |
|---|
| 36 | # Internally ow_add_private_library_dirs() uses a variable named ${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS |
|---|
| 37 | # It uses CMake function link_directories(), see ow_prepare_binary() for more details |
|---|
| 38 | # |
|---|
| 39 | # Copyright (C) 2006-2010 Mbdsys |
|---|
| 40 | # |
|---|
| 41 | # Redistribution and use is allowed according to the terms of the BSD license. |
|---|
| 42 | # For details see the accompanying COPYING file. |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | macro (ow_add_private_library_dirs) |
|---|
| 46 | |
|---|
| 47 | ow_check_project() |
|---|
| 48 | |
|---|
| 49 | if (${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS) |
|---|
| 50 | set(${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS |
|---|
| 51 | ${${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS} |
|---|
| 52 | ${ARGN} |
|---|
| 53 | CACHE INTERNAL "${PROJECT_NAME} private library directories" |
|---|
| 54 | ) |
|---|
| 55 | else (${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS) |
|---|
| 56 | set(${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS |
|---|
| 57 | ${ARGN} |
|---|
| 58 | CACHE INTERNAL "${PROJECT_NAME} private library directories" |
|---|
| 59 | ) |
|---|
| 60 | endif (${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS) |
|---|
| 61 | |
|---|
| 62 | ow_unique(unique ${${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS}) |
|---|
| 63 | set(${PROJECT_NAME}_PRIVATE_LIBRARY_DIRS |
|---|
| 64 | ${unique} |
|---|
| 65 | CACHE INTERNAL "${PROJECT_NAME} private library directories" |
|---|
| 66 | ) |
|---|
| 67 | |
|---|
| 68 | endmacro (ow_add_private_library_dirs) |
|---|