File tree Expand file tree Collapse file tree 17 files changed +82
-64
lines changed Expand file tree Collapse file tree 17 files changed +82
-64
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ set_target_properties(${target_name} PROPERTIES
1616if (WINDOWS)
1717 set_target_properties (${target_name} PROPERTIES
1818 # need use absolutely path
19- IMPORTED_LOCATION "${platform_spec_path} /lib${lib_name} .lib"
19+ IMPORTED_LOCATION_DEBUG "${platform_spec_path} /debug/lib${lib_name} .lib"
20+ IMPORTED_LOCATION_RELEASE "${platform_spec_path} /release/lib${lib_name} .lib"
2021 )
2122else ()
2223 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ set_property(TARGET ${target_name} APPEND PROPERTY
1818
1919if (WINDOWS)
2020 set_target_properties (${target_name} PROPERTIES
21- IMPORTED_LOCATION "${platform_spec_path} /lib${lib_name} .lib"
21+ IMPORTED_LOCATION_DEBUG "${platform_spec_path} /debug/lib${lib_name} .lib"
22+ IMPORTED_LOCATION_RELEASE "${platform_spec_path} /release/lib${lib_name} .lib"
2223 )
2324else ()
2425 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ set_target_properties(${target_name} PROPERTIES
1414)
1515if (WINDOWS)
1616 set_target_properties (${target_name} PROPERTIES
17- IMPORTED_LOCATION "${platform_spec_path} /lib${lib_name} .lib"
17+ IMPORTED_LOCATION_DEBUG "${platform_spec_path} /debug-lib/lib${lib_name} .lib"
18+ IMPORTED_LOCATION_RELEASE "${platform_spec_path} /release-lib/lib${lib_name} .lib"
1819 )
1920else ()
2021 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change 2323 endif ()
2424 endif ()
2525
26- # part libs existed debug and release both type
27- string (TOLOWER ${CMAKE_BUILD_TYPE} _type_folder)
28- # Visual Studio 2017 default build type include "Debug Release MinSizRel RelWithDebInfo"
29- if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
30- set (_type_folder "debug" )
31- elseif (${CMAKE_BUILD_TYPE} STREQUAL "MinSizRel" )
32- set (_type_folder "release" )
33- endif ()
34-
3526# set platform specific path
3627set (_path_prefix ${CMAKE_CURRENT_SOURCE_DIR} /prebuilt/)
3728if (IOS)
@@ -42,14 +33,7 @@ elseif(ANDROID)
4233 set (platform_spec_path android/${ANDROID_ABI} )
4334elseif (WINDOWS)
4435 set (platform_name win32 )
45- # win32/, win32/debug, win32/debug-lib
46- if (EXISTS ${_path_prefix} /win32 /${_type_folder} -lib)
47- set (platform_spec_path win32 /${_type_folder} -lib)
48- elseif (EXISTS ${_path_prefix} win32 /${_type_folder} )
49- set (platform_spec_path win32 /${_type_folder} )
50- else ()
51- set (platform_spec_path win32 )
52- endif ()
36+ set (platform_spec_path win32 )
5337elseif (MACOSX)
5438 set (platform_name mac)
5539 set (platform_spec_path mac)
Original file line number Diff line number Diff line change @@ -7,16 +7,20 @@ project(${lib_name})
77
88include (../cmake/CocosExternalConfig.cmake)
99
10- add_library (${target_name} STATIC IMPORTED GLOBAL )
10+ if (WINDOWS)
11+ add_library (${target_name} SHARED IMPORTED GLOBAL )
12+ else ()
13+ add_library (${target_name} STATIC IMPORTED GLOBAL )
14+ endif ()
1115
1216set_target_properties (${target_name} PROPERTIES
1317 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
1418)
1519
1620if (WINDOWS)
1721 set_target_properties (${target_name} PROPERTIES
18- CC_DEPEND_DLLS "${platform_spec_path} /lib${lib_name} .dll"
19- IMPORTED_LOCATION "${platform_spec_path} /lib${lib_name} .lib"
22+ IMPORTED_LOCATION "${platform_spec_path} /lib${lib_name} .dll"
23+ IMPORTED_IMPLIB "${platform_spec_path} /lib${lib_name} .lib"
2024 )
2125else ()
2226 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -6,15 +6,19 @@ project(${lib_name})
66
77include (../../cmake/CocosExternalConfig.cmake)
88
9- add_library (${target_name} STATIC IMPORTED GLOBAL )
9+ if (WINDOWS)
10+ add_library (${target_name} SHARED IMPORTED GLOBAL )
11+ else ()
12+ add_library (${target_name} STATIC IMPORTED GLOBAL )
13+ endif ()
1014
1115set_target_properties (${target_name} PROPERTIES
1216 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
1317)
1418if (WINDOWS)
1519 set_target_properties (${target_name} PROPERTIES
16- CC_DEPEND_DLLS "${platform_spec_path} /lua51.dll"
17- IMPORTED_LOCATION "${platform_spec_path} /lua51.lib"
20+ IMPORTED_LOCATION "${platform_spec_path} /lua51.dll"
21+ IMPORTED_IMPLIB "${platform_spec_path} /lua51.lib"
1822 )
1923else ()
2024 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -10,15 +10,19 @@ include(../cmake/CocosExternalConfig.cmake)
1010macro (set_openssl_sub_target sub_lib_name)
1111
1212 set (sub_target_name ext_${sub_lib_name} )
13- add_library (${sub_target_name} STATIC IMPORTED GLOBAL )
13+ if (WINDOWS)
14+ add_library (${sub_target_name} SHARED IMPORTED GLOBAL )
15+ else ()
16+ add_library (${sub_target_name} STATIC IMPORTED GLOBAL )
17+ endif ()
1418
1519 set_target_properties (${sub_target_name} PROPERTIES
1620 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
1721 )
1822 if (WINDOWS)
1923 set_target_properties (${sub_target_name} PROPERTIES
20- CC_DEPEND_DLLS "${platform_spec_path} /lib${sub_lib_name} -1_1.dll"
21- IMPORTED_LOCATION "${platform_spec_path} /lib${sub_lib_name} .lib"
24+ IMPORTED_LOCATION "${platform_spec_path} /lib${sub_lib_name} -1_1.dll"
25+ IMPORTED_IMPLIB "${platform_spec_path} /lib${sub_lib_name} .lib"
2226 )
2327 else ()
2428 set_target_properties (${sub_target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ project(${lib_name})
77
88include (../cmake/CocosExternalConfig.cmake)
99
10- add_library (${target_name} STATIC IMPORTED GLOBAL )
10+ if (WINDOWS)
11+ add_library (${target_name} SHARED IMPORTED GLOBAL )
12+ else ()
13+ add_library (${target_name} STATIC IMPORTED GLOBAL )
14+ endif ()
1115
1216set_target_properties (${target_name} PROPERTIES
1317 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
1418)
1519if (WINDOWS)
1620 set_target_properties (${target_name} PROPERTIES
17- CC_DEPEND_DLLS "${platform_spec_path} /mozjs-33.dll"
18- IMPORTED_LOCATION "${platform_spec_path} /mozjs-33.lib"
21+ IMPORTED_LOCATION "${platform_spec_path} /mozjs-33.dll"
22+ IMPORTED_IMPLIB "${platform_spec_path} /mozjs-33.lib"
1923 )
2024else ()
2125 set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -7,14 +7,18 @@ project(${lib_name})
77
88include (../cmake/CocosExternalConfig.cmake)
99
10- add_library (${target_name} STATIC IMPORTED GLOBAL )
10+ if (WINDOWS)
11+ add_library (${target_name} SHARED IMPORTED GLOBAL )
12+ else ()
13+ add_library (${target_name} STATIC IMPORTED GLOBAL )
14+ endif ()
1115
1216set_target_properties (${target_name} PROPERTIES
1317 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
1418)
1519if (WINDOWS)
1620 set_target_properties (${target_name} PROPERTIES
17- CC_DEPEND_DLLS "${CMAKE_CURRENT_SOURCE_DIR} /libraries/${platform_name} /${lib_name} .dll"
18- IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR} /libraries/${platform_name} /${lib_name} .lib"
21+ IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR} /libraries/${platform_name} /${lib_name} .dll"
22+ IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR} /libraries/${platform_name} /${lib_name} .lib"
1923 )
2024endif ()
Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ project(${lib_name})
77
88include (../cmake/CocosExternalConfig.cmake)
99
10- add_library (${target_name} STATIC IMPORTED GLOBAL )
10+ if (WINDOWS)
11+ add_library (${target_name} SHARED IMPORTED GLOBAL )
12+ else ()
13+ add_library (${target_name} STATIC IMPORTED GLOBAL )
14+ endif ()
1115
1216set_target_properties (${target_name} PROPERTIES
1317 INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
1418)
1519if (WINDOWS)
1620 set_target_properties (${target_name} PROPERTIES
17- CC_DEPEND_DLLS "${platform_spec_path} /${lib_name} .dll"
18- IMPORTED_LOCATION "${platform_spec_path} /${lib_name} _a.lib"
21+ IMPORTED_LOCATION "${platform_spec_path} /${lib_name} .dll"
22+ IMPORTED_IMPLIB "${platform_spec_path} /${lib_name} _a.lib"
1923 )
2024else ()
2125 set_target_properties (${target_name} PROPERTIES
You can’t perform that action at this time.
0 commit comments