Changeset View
Changeset View
Standalone View
Standalone View
build_files/cmake/macros.cmake
| Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | foreach(_INC ${ARGV}) | ||||
| list(APPEND _ALL_INCS ${_ABS_INC}) | list(APPEND _ALL_INCS ${_ABS_INC}) | ||||
| # if(NOT EXISTS "${_ABS_INC}/") | # if(NOT EXISTS "${_ABS_INC}/") | ||||
| # message(FATAL_ERROR "Include not found: ${_ABS_INC}/") | # message(FATAL_ERROR "Include not found: ${_ABS_INC}/") | ||||
| # endif() | # endif() | ||||
| endforeach() | endforeach() | ||||
| include_directories(SYSTEM ${_ALL_INCS}) | include_directories(SYSTEM ${_ALL_INCS}) | ||||
| endfunction() | endfunction() | ||||
| function(blender_source_group | function(blender_source_group | ||||
LazyDodo: whitespace changes | |||||
| name | |||||
| sources | sources | ||||
| ) | ) | ||||
| # if enabled, use the sources directories as filters. | # if enabled, use the sources directories as filters. | ||||
| if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS) | if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS) | ||||
| foreach(_SRC ${sources}) | foreach(_SRC ${sources}) | ||||
| # remove ../'s | # remove ../'s | ||||
| get_filename_component(_SRC_DIR ${_SRC} REALPATH) | get_filename_component(_SRC_DIR ${_SRC} REALPATH) | ||||
| Show All 19 Lines | foreach(_SRC ${sources}) | ||||
| elseif(${_SRC_EXT} MATCHES ".glsl$") | elseif(${_SRC_EXT} MATCHES ".glsl$") | ||||
| set(GROUP_ID "Shaders") | set(GROUP_ID "Shaders") | ||||
| else() | else() | ||||
| set(GROUP_ID "Source Files") | set(GROUP_ID "Source Files") | ||||
| endif() | endif() | ||||
| source_group("${GROUP_ID}" FILES ${_SRC}) | source_group("${GROUP_ID}" FILES ${_SRC}) | ||||
| endforeach() | endforeach() | ||||
| endif() | endif() | ||||
| # if enabled, set the FOLDER property for visual studio projects | |||||
| if(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS) | |||||
| get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) | |||||
| string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir}) | |||||
| set_target_properties(${name} PROPERTIES FOLDER ${FolderDir}) | |||||
| endif() | |||||
| endfunction() | endfunction() | ||||
| # Support per-target CMake flags | # Support per-target CMake flags | ||||
| # Read from: CMAKE_C_FLAGS_**** (made upper case) when set. | # Read from: CMAKE_C_FLAGS_**** (made upper case) when set. | ||||
| # | # | ||||
| # 'name' should always match the target name, | # 'name' should always match the target name, | ||||
| # use this macro before add_library or add_executable. | # use this macro before add_library or add_executable. | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | foreach(library ${library_deps}) | ||||
| 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) | ||||
| blender_source_group("${sources}") | blender_source_group("${name}" "${sources}") | ||||
| # if enabled, set the FOLDER property for visual studio projects | |||||
| if(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS) | |||||
| get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) | |||||
| string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir}) | |||||
| set_target_properties(${name} PROPERTIES FOLDER ${FolderDir}) | |||||
| endif() | |||||
| list_assert_duplicates("${sources}") | list_assert_duplicates("${sources}") | ||||
| list_assert_duplicates("${includes}") | list_assert_duplicates("${includes}") | ||||
| # Not for system includes because they can resolve to the same path | # Not for system includes because they can resolve to the same path | ||||
| # list_assert_duplicates("${includes_sys}") | # list_assert_duplicates("${includes_sys}") | ||||
| endfunction() | endfunction() | ||||
| ▲ Show 20 Lines • Show All 850 Lines • Show Last 20 Lines | |||||
whitespace changes