-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff21632
commit a23e2cf
Showing
4 changed files
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
From cf050a7e23d6d7e0873cc84c1aa98357ae9070be Mon Sep 17 00:00:00 2001 | ||
From: Vassil Vassilev <[email protected]> | ||
Date: Mon, 18 Mar 2024 20:09:06 +0000 | ||
Subject: [PATCH] [cmake] Clean up and improve the CppInterOp config for | ||
Windows. | ||
|
||
--- | ||
cmake/CppInterOp/CppInterOpConfig.cmake.in | 30 ++++++++++++++-------- | ||
1 file changed, 20 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/cmake/CppInterOp/CppInterOpConfig.cmake.in b/cmake/CppInterOp/CppInterOpConfig.cmake.in | ||
index 414c1c0..4a8c821 100644 | ||
--- a/cmake/CppInterOp/CppInterOpConfig.cmake.in | ||
+++ b/cmake/CppInterOp/CppInterOpConfig.cmake.in | ||
@@ -9,21 +9,27 @@ get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}" | ||
# Determine CMAKE_SHARED_LIBRARY_SUFFIX based on operating system | ||
include(CMakeSystemSpecificInformation) | ||
|
||
+if(MSVC) | ||
+ set(shared_lib_dir bin) | ||
+else() | ||
+ set(shared_lib_dir lib) | ||
+endif() | ||
+ | ||
### build/install workaround | ||
if (@BUILD_SHARED_LIBS@) | ||
- set(__lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
- set(__lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) | ||
+ set(_lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
+ set(_lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) | ||
else() | ||
- set(__lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
- set(__lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX}) | ||
+ set(_lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
+ set(_lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX}) | ||
endif() | ||
|
||
if (IS_DIRECTORY "${CPPINTEROP_INSTALL_PREFIX}/include") | ||
set(_include "${CPPINTEROP_INSTALL_PREFIX}/include") | ||
- set(_libs "${CPPINTEROP_INSTALL_PREFIX}/lib/${__lib_prefix}clangCppInterOp${__lib_suffix}") | ||
+ set(_lib "${CPPINTEROP_INSTALL_PREFIX}/${shared_lib_dir}/${_lib_prefix}clangCppInterOp${_lib_suffix}") | ||
else() | ||
set(_include "@CMAKE_CURRENT_SOURCE_DIR@/include") | ||
- set(_libs "@CMAKE_CURRENT_BINARY_DIR@/lib/${__lib_prefix}clangCppInterOp${__lib_suffix}") | ||
+ set(_lib "@CMAKE_CURRENT_BINARY_DIR@/${shared_lib_dir}/${_lib_prefix}clangCppInterOp${_lib_suffix}") | ||
endif() | ||
|
||
### | ||
@@ -31,7 +37,7 @@ endif() | ||
set(CPPINTEROP_EXPORTED_TARGETS "clangCppInterOp") | ||
set(CPPINTEROP_CMAKE_DIR "${_cmake}") | ||
set(CPPINTEROP_INCLUDE_DIRS "${_include}") | ||
-set(CPPINTEROP_LIBRARIES "${_libs}") | ||
+set(CPPINTEROP_LIBRARIES "${_lib}") | ||
|
||
# Provide all our library targets to users. | ||
if (@BUILD_SHARED_LIBS@) | ||
@@ -39,9 +45,13 @@ if (@BUILD_SHARED_LIBS@) | ||
else() | ||
add_library(clangCppInterOp STATIC IMPORTED) | ||
endif() | ||
-set_property(TARGET clangCppInterOp PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_include}") | ||
-set_property(TARGET clangCppInterOp PROPERTY IMPORTED_LOCATION "${_libs}") | ||
+set_target_properties(clangCppInterOp PROPERTIES | ||
+ INTERFACE_INCLUDE_DIRECTORIES "${_include}" | ||
+ IMPORTED_LOCATION "${_lib}" | ||
+ ) | ||
|
||
+unset(_lib_prefix) | ||
+unset(_lib_suffix) | ||
unset(_cmake) | ||
unset(_include) | ||
-unset(_libs) | ||
+unset(_lib) | ||
-- | ||
2.37.1 (Apple Git-137.1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters