@@ -12,12 +12,11 @@ macro(doption name help default def)
12
12
endmacro ()
13
13
14
14
macro (make_simple_import name varname header library)
15
- add_library (${name} UNKNOWN IMPORTED )
15
+ add_library (${name} INTERFACE )
16
16
find_path (${varname} _INCLUDE ${header} )
17
17
find_library (${varname} _LIB NAMES ${library} -static ${library} )
18
- set_target_properties (${name} PROPERTIES
19
- INTERFACE_INCLUDE_DIRECTORIES "${${varname} _INCLUDE}"
20
- IMPORTED_LOCATION "${${varname} _LIB}" )
18
+ target_include_directories (${name} INTERFACE "${${varname} _INCLUDE}" )
19
+ target_link_libraries (${name} INTERFACE "${${varname} _LIB}" )
21
20
endmacro ()
22
21
23
22
option (BUILD_SHARED_LIBS "build shared library" ON )
@@ -38,12 +37,11 @@ doption(ENABLE_PHYSFS "enable PhysicsFS in playsound" OFF SUPPORT_PHYSFS)
38
37
doption(STATIC_FLAC "FLAC should be linked as a static library" OFF FLAC__NO_DLL)
39
38
40
39
# SDL2
41
- add_library (SDL2::SDL2 UNKNOWN IMPORTED )
40
+ add_library (SDL2::SDL2 INTERFACE )
42
41
find_path (SDL2_INCLUDE SDL.h PATH_SUFFIXES SDL2)
43
42
find_library (SDL2_LIB NAMES SDL2 SDL2d)
44
- set_target_properties (SDL2::SDL2 PROPERTIES
45
- INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE} "
46
- IMPORTED_LOCATION "${SDL2_LIB} " )
43
+ target_include_directories (SDL2::SDL2 INTERFACE "${SDL2_INCLUDE} " )
44
+ target_link_libraries (SDL2::SDL2 INTERFACE "${SDL2_LIB} " )
47
45
if (WIN32 )
48
46
set (libs user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 shell32)
49
47
else ()
@@ -52,21 +50,18 @@ else()
52
50
list (APPEND libs rt)
53
51
endif ()
54
52
endif ()
55
- set_target_properties (SDL2::SDL2 PROPERTIES
56
- INTERFACE_LINK_LIBRARIES "${libs} " )
53
+ target_link_libraries (SDL2::SDL2 INTERFACE "${libs} " )
57
54
unset (libs)
58
55
59
56
if (WIN32 )
60
- add_library (SDL2::SDL2main UNKNOWN IMPORTED )
57
+ add_library (SDL2::SDL2main INTERFACE )
61
58
set (libs)
62
59
if (MINGW)
63
60
list (APPEND libs mingw32)
64
61
endif ()
65
62
find_library (SDL2MAIN_LIB NAMES SDL2main SDL2maind)
66
63
list (APPEND libs "${SDL2MAIN_LIB} " )
67
- set_target_properties (SDL2::SDL2main PROPERTIES
68
- IMPORTED_LOCATION "${SDL2MAIN_LIB} "
69
- INTERFACE_LINK_LIBRARIES "${libs} " )
64
+ target_link_libraries (SDL2::SDL2main INTERFACE "${libs} " )
70
65
unset (libs)
71
66
else ()
72
67
add_library (SDL2::SDL2main INTERFACE IMPORTED )
@@ -95,12 +90,11 @@ endif()
95
90
96
91
# ogg/flac
97
92
if (ENABLE_FLAC)
98
- add_library (ogg::FLAC UNKNOWN IMPORTED )
93
+ add_library (ogg::FLAC INTERFACE )
99
94
find_path (FLAC_INCLUDE FLAC/stream_decoder.h)
100
95
find_library (FLAC_LIB NAMES flac FLAC)
101
- set_target_properties (ogg::FLAC PROPERTIES
102
- INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE} "
103
- IMPORTED_LOCATION "${FLAC_LIB} " )
96
+ target_include_directories (ogg::FLAC INTERFACE "${FLAC_INCLUDE} " )
97
+ target_link_libraries (ogg::FLAC INTERFACE "${FLAC_LIB} " )
104
98
endif ()
105
99
106
100
# ogg/speex
0 commit comments