Changeset View
Changeset View
Standalone View
Standalone View
build_files/cmake/macros.cmake
| Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
| endif() | endif() | ||||
| function(target_link_libraries_optimized | function(target_link_libraries_optimized | ||||
| TARGET | TARGET | ||||
| LIBS | LIBS | ||||
| ) | ) | ||||
| foreach(_LIB ${LIBS}) | foreach(_LIB ${LIBS}) | ||||
| target_link_libraries(${TARGET} optimized "${_LIB}") | target_link_libraries(${TARGET} INTERFACE optimized "${_LIB}") | ||||
| endforeach() | endforeach() | ||||
| endfunction() | endfunction() | ||||
| function(target_link_libraries_debug | function(target_link_libraries_debug | ||||
| TARGET | TARGET | ||||
| LIBS | LIBS | ||||
| ) | ) | ||||
| foreach(_LIB ${LIBS}) | foreach(_LIB ${LIBS}) | ||||
| target_link_libraries(${TARGET} debug "${_LIB}") | target_link_libraries(${TARGET} INTERFACE debug "${_LIB}") | ||||
| endforeach() | endforeach() | ||||
| endfunction() | endfunction() | ||||
| # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/ | # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/ | ||||
| # use it instead of include_directories() | # use it instead of include_directories() | ||||
| function(blender_include_dirs | function(blender_include_dirs | ||||
| includes | includes | ||||
| ) | ) | ||||
| ▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | if(NOT "${library_deps}" STREQUAL "") | ||||
| set(next_library_mode "") | set(next_library_mode "") | ||||
| foreach(library ${library_deps}) | foreach(library ${library_deps}) | ||||
| string(TOLOWER "${library}" library_lower) | string(TOLOWER "${library}" library_lower) | ||||
| if(("${library_lower}" STREQUAL "optimized") OR | if(("${library_lower}" STREQUAL "optimized") OR | ||||
| ("${library_lower}" STREQUAL "debug")) | ("${library_lower}" STREQUAL "debug")) | ||||
| set(next_library_mode "${library_lower}") | set(next_library_mode "${library_lower}") | ||||
| else() | else() | ||||
| if("${next_library_mode}" STREQUAL "optimized") | if("${next_library_mode}" STREQUAL "optimized") | ||||
| target_link_libraries(${name} optimized ${library}) | target_link_libraries(${name} INTERFACE optimized ${library}) | ||||
| elseif("${next_library_mode}" STREQUAL "debug") | elseif("${next_library_mode}" STREQUAL "debug") | ||||
| target_link_libraries(${name} debug ${library}) | target_link_libraries(${name} INTERFACE debug ${library}) | ||||
| else() | else() | ||||
| target_link_libraries(${name} ${library}) | target_link_libraries(${name} INTERFACE ${library}) | ||||
| endif() | endif() | ||||
| set(next_library_mode "") | set(next_library_mode "") | ||||
| endif() | endif() | ||||
| endforeach() | endforeach() | ||||
| endif() | endif() | ||||
| # works fine without having the includes | # works fine without having the includes | ||||
| # listed is helpful for IDE's (QtCreator/MSVC) | # listed is helpful for IDE's (QtCreator/MSVC) | ||||
| ▲ Show 20 Lines • Show All 859 Lines • Show Last 20 Lines | |||||