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
16
16
if (WINDOWS )
17
17
set_target_properties (${target_name} PROPERTIES
18
18
# 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"
20
21
)
21
22
else ()
22
23
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
18
18
19
19
if (WINDOWS )
20
20
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"
22
23
)
23
24
else ()
24
25
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
14
14
)
15
15
if (WINDOWS )
16
16
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"
18
19
)
19
20
else ()
20
21
set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change 23
23
endif ()
24
24
endif ()
25
25
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
-
35
26
# set platform specific path
36
27
set (_path_prefix ${CMAKE_CURRENT_SOURCE_DIR} /prebuilt/ )
37
28
if (IOS )
@@ -42,14 +33,7 @@ elseif(ANDROID)
42
33
set (platform_spec_path android/${ANDROID_ABI} )
43
34
elseif (WINDOWS )
44
35
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 )
53
37
elseif (MACOSX )
54
38
set (platform_name mac )
55
39
set (platform_spec_path mac )
Original file line number Diff line number Diff line change @@ -7,16 +7,20 @@ project(${lib_name})
7
7
8
8
include (../cmake/CocosExternalConfig.cmake )
9
9
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 ()
11
15
12
16
set_target_properties (${target_name} PROPERTIES
13
17
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
14
18
)
15
19
16
20
if (WINDOWS )
17
21
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"
20
24
)
21
25
else ()
22
26
set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -6,15 +6,19 @@ project(${lib_name})
6
6
7
7
include (../../cmake/CocosExternalConfig.cmake )
8
8
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 ()
10
14
11
15
set_target_properties (${target_name} PROPERTIES
12
16
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
13
17
)
14
18
if (WINDOWS )
15
19
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"
18
22
)
19
23
else ()
20
24
set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -10,15 +10,19 @@ include(../cmake/CocosExternalConfig.cmake)
10
10
macro (set_openssl_sub_target sub_lib_name )
11
11
12
12
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 ()
14
18
15
19
set_target_properties (${sub_target_name} PROPERTIES
16
20
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
17
21
)
18
22
if (WINDOWS )
19
23
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"
22
26
)
23
27
else ()
24
28
set_target_properties (${sub_target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ project(${lib_name})
7
7
8
8
include (../cmake/CocosExternalConfig.cmake )
9
9
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 ()
11
15
12
16
set_target_properties (${target_name} PROPERTIES
13
17
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include/${platform_name} "
14
18
)
15
19
if (WINDOWS )
16
20
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"
19
23
)
20
24
else ()
21
25
set_target_properties (${target_name} PROPERTIES
Original file line number Diff line number Diff line change @@ -7,14 +7,18 @@ project(${lib_name})
7
7
8
8
include (../cmake/CocosExternalConfig.cmake )
9
9
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 ()
11
15
12
16
set_target_properties (${target_name} PROPERTIES
13
17
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
14
18
)
15
19
if (WINDOWS )
16
20
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"
19
23
)
20
24
endif ()
Original file line number Diff line number Diff line change @@ -7,15 +7,19 @@ project(${lib_name})
7
7
8
8
include (../cmake/CocosExternalConfig.cmake )
9
9
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 ()
11
15
12
16
set_target_properties (${target_name} PROPERTIES
13
17
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR} /include"
14
18
)
15
19
if (WINDOWS )
16
20
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"
19
23
)
20
24
else ()
21
25
set_target_properties (${target_name} PROPERTIES
You can’t perform that action at this time.
0 commit comments