https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b28f8d9bac5499b7f88b…
commit 8b28f8d9bac5499b7f88b7fbbc3e8263f2c8e361
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Oct 15 11:47:03 2020 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Tue Oct 20 21:44:54 2020 +0200
[CMAKE] Allow INTERFACE libraries for MSVC IDEs
---
sdk/cmake/CMakeMacros.cmake | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index 707a6b2e524..e3ed4a00545 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -474,15 +474,17 @@ elseif(USE_FOLDER_STRUCTURE)
function(add_library name)
_add_library(${name} ${ARGN})
- get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL)
- if(_target_excluded AND ${name} MATCHES "^lib.*")
- set_property(TARGET "${name}" PROPERTY FOLDER
"Importlibs")
- else()
- string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1
CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
- set_property(TARGET "${name}" PROPERTY FOLDER
"${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
+ get_target_property(_type ${name} TYPE)
+ if (NOT _type STREQUAL "INTERFACE_LIBRARY")
+ get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL)
+ if(_target_excluded AND ${name} MATCHES "^lib.*")
+ set_property(TARGET "${name}" PROPERTY FOLDER
"Importlibs")
+ else()
+ string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH}
-1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
+ set_property(TARGET "${name}" PROPERTY FOLDER
"${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
+ endif()
endif()
# cmake adds a module_EXPORTS define when compiling a module or a shared library.
We don't use that.
- get_target_property(_type ${name} TYPE)
if(_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
endif()