Author: hbelusca
Date: Sat Oct 22 22:51:34 2016
New Revision: 73027
URL:
http://svn.reactos.org/svn/reactos?rev=73027&view=rev
Log:
[CMAKE]: Introduce a evil workaround for the problem described in CORE-12205/CORE-12206,
that was unveiled by commit r73024. CMake gurus, please review & make suggestions! :)
Modified:
trunk/reactos/sdk/cmake/CMakeMacros.cmake
Modified: trunk/reactos/sdk/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/cmake/CMakeMacros.cmak…
==============================================================================
--- trunk/reactos/sdk/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/sdk/cmake/CMakeMacros.cmake [iso-8859-1] Sat Oct 22 22:51:34 2016
@@ -496,6 +496,18 @@
function(add_library name)
_add_library(${name} ${ARGN})
+##
+## The following is a workaround for a CMake bug. Inspired by:
+##
http://stackoverflow.com/questions/24926868/cmake-3-0-add-library-of-type-i…
+##
+## Beginning of the workaround:
+ get_target_property(_TARGET_TYPE ${name} TYPE)
+ if(_TARGET_TYPE STREQUAL "INTERFACE_LIBRARY")
+ unset(_target_excluded)
+ else()
+##
+## This is the original code:
+##
get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL)
if(_target_excluded AND ${name} MATCHES "^lib.*")
set_property(TARGET "${name}" PROPERTY FOLDER
"Importlibs")
@@ -503,6 +515,10 @@
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()
+##
+## End of workaround
+ endif()
+##
endfunction()
function(add_executable name)