comparison libmlk-core/CMakeLists.txt @ 584:f2737a931658

cmake: start installing
author David Demelier <markand@malikania.fr>
date Sat, 18 Mar 2023 10:57:29 +0100
parents cedfdbc0e9a7
children 4349b591c3ac
comparison
equal deleted inserted replaced
583:5a4e5b852f8a 584:f2737a931658
18 18
19 project(libmlk-core) 19 project(libmlk-core)
20 20
21 set( 21 set(
22 SOURCES 22 SOURCES
23 ${libmlk-core_SOURCE_DIR}/mlk/core/game.c
24 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.c
25 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.c
26 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.c
27 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.c
28 ${libmlk-core_SOURCE_DIR}/mlk/core/util.c
29 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.c
23 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.c 30 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.c
31 ${libmlk-core_SOURCE_DIR}/mlk/core/state.c
32 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.c
33 ${libmlk-core_SOURCE_DIR}/mlk/core/font.c
34 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.c
35 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.c
36 ${libmlk-core_SOURCE_DIR}/mlk/core/gamepad.c
37 ${libmlk-core_SOURCE_DIR}/mlk/core/image.c
38 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.c
39 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.c
40 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.c
41 ${libmlk-core_SOURCE_DIR}/mlk/core/core.c
42 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.c
43 ${libmlk-core_SOURCE_DIR}/mlk/core/err.c
44 ${libmlk-core_SOURCE_DIR}/mlk/core/music.c
45 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.c
46 ${libmlk-core_SOURCE_DIR}/mlk/core/event.c
47 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.c
48 ${libmlk-core_SOURCE_DIR}/mlk/core/action.c
49 ${libmlk-core_SOURCE_DIR}/mlk/core/window.c
50 )
51
52 set(
53 HEADERS
24 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.h 54 ${libmlk-core_SOURCE_DIR}/mlk/core/action-script.h
25 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.c
26 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.h 55 ${libmlk-core_SOURCE_DIR}/mlk/core/action-stack.h
27 ${libmlk-core_SOURCE_DIR}/mlk/core/action.c
28 ${libmlk-core_SOURCE_DIR}/mlk/core/action.h 56 ${libmlk-core_SOURCE_DIR}/mlk/core/action.h
29 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.c
30 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.h 57 ${libmlk-core_SOURCE_DIR}/mlk/core/alloc.h
31 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.c
32 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.h 58 ${libmlk-core_SOURCE_DIR}/mlk/core/animation.h
33 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.c
34 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.h 59 ${libmlk-core_SOURCE_DIR}/mlk/core/clock.h
35 ${libmlk-core_SOURCE_DIR}/mlk/core/color.h 60 ${libmlk-core_SOURCE_DIR}/mlk/core/color.h
36 ${libmlk-core_SOURCE_DIR}/mlk/core/core.c
37 ${libmlk-core_SOURCE_DIR}/mlk/core/core.h 61 ${libmlk-core_SOURCE_DIR}/mlk/core/core.h
38 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.c
39 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.h 62 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable-stack.h
40 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.c
41 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.h 63 ${libmlk-core_SOURCE_DIR}/mlk/core/drawable.h
42 ${libmlk-core_SOURCE_DIR}/mlk/core/err.c
43 ${libmlk-core_SOURCE_DIR}/mlk/core/err.h 64 ${libmlk-core_SOURCE_DIR}/mlk/core/err.h
44 ${libmlk-core_SOURCE_DIR}/mlk/core/event.c
45 ${libmlk-core_SOURCE_DIR}/mlk/core/event.h 65 ${libmlk-core_SOURCE_DIR}/mlk/core/event.h
46 ${libmlk-core_SOURCE_DIR}/mlk/core/font.c
47 ${libmlk-core_SOURCE_DIR}/mlk/core/font.h 66 ${libmlk-core_SOURCE_DIR}/mlk/core/font.h
48 ${libmlk-core_SOURCE_DIR}/mlk/core/game.c
49 ${libmlk-core_SOURCE_DIR}/mlk/core/game.h 67 ${libmlk-core_SOURCE_DIR}/mlk/core/game.h
50 ${libmlk-core_SOURCE_DIR}/mlk/core/image.c 68 ${libmlk-core_SOURCE_DIR}/mlk/core/gamepad.h
51 ${libmlk-core_SOURCE_DIR}/mlk/core/image.h 69 ${libmlk-core_SOURCE_DIR}/mlk/core/image.h
52 ${libmlk-core_SOURCE_DIR}/mlk/core/key.h 70 ${libmlk-core_SOURCE_DIR}/mlk/core/key.h
53 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.c
54 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.h 71 ${libmlk-core_SOURCE_DIR}/mlk/core/maths.h
55 ${libmlk-core_SOURCE_DIR}/mlk/core/mouse.h 72 ${libmlk-core_SOURCE_DIR}/mlk/core/mouse.h
56 ${libmlk-core_SOURCE_DIR}/mlk/core/music.c
57 ${libmlk-core_SOURCE_DIR}/mlk/core/music.h 73 ${libmlk-core_SOURCE_DIR}/mlk/core/music.h
58 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.c
59 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.h 74 ${libmlk-core_SOURCE_DIR}/mlk/core/painter.h
60 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.c
61 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.h 75 ${libmlk-core_SOURCE_DIR}/mlk/core/panic.h
62 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.c
63 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.h 76 ${libmlk-core_SOURCE_DIR}/mlk/core/sound.h
64 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.c
65 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.h 77 ${libmlk-core_SOURCE_DIR}/mlk/core/sprite.h
66 ${libmlk-core_SOURCE_DIR}/mlk/core/state.c
67 ${libmlk-core_SOURCE_DIR}/mlk/core/state.h 78 ${libmlk-core_SOURCE_DIR}/mlk/core/state.h
68 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.c
69 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.h 79 ${libmlk-core_SOURCE_DIR}/mlk/core/sys.h
70 ${libmlk-core_SOURCE_DIR}/mlk/core/sys_p.h 80 ${libmlk-core_SOURCE_DIR}/mlk/core/sys_p.h
71 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.c
72 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.h 81 ${libmlk-core_SOURCE_DIR}/mlk/core/texture.h
73 ${libmlk-core_SOURCE_DIR}/mlk/core/texture_p.h 82 ${libmlk-core_SOURCE_DIR}/mlk/core/texture_p.h
74 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.c
75 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.h 83 ${libmlk-core_SOURCE_DIR}/mlk/core/trace.h
76 ${libmlk-core_SOURCE_DIR}/mlk/core/util.c
77 ${libmlk-core_SOURCE_DIR}/mlk/core/util.h 84 ${libmlk-core_SOURCE_DIR}/mlk/core/util.h
78 ${libmlk-core_SOURCE_DIR}/mlk/core/window.c
79 ${libmlk-core_SOURCE_DIR}/mlk/core/window.h 85 ${libmlk-core_SOURCE_DIR}/mlk/core/window.h
80 ${libmlk-core_SOURCE_DIR}/mlk/core/window_p.h 86 ${libmlk-core_SOURCE_DIR}/mlk/core/window_p.h
81 ) 87 )
82 88
83 set( 89 set(
87 93
88 if (MLK_WITH_NLS) 94 if (MLK_WITH_NLS)
89 list(APPEND LIBRARIES ${Intl_LIBRARIES}) 95 list(APPEND LIBRARIES ${Intl_LIBRARIES})
90 endif () 96 endif ()
91 97
92 if (MLK_WITH_ZSTD)
93 list(APPEND LIBRARIES ZSTD::ZSTD)
94 endif ()
95
96 if (MLK_WITH_ZIP)
97 list(APPEND LIBRARIES Libzip::Libzip)
98 endif ()
99
100 if (CMAKE_SYSTEM_NAME MATCHES "Windows") 98 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
101 list(APPEND LIBRARIES shlwapi) 99 list(APPEND LIBRARIES shlwapi)
102 endif () 100 endif ()
103 101
104 if (M_LIBRARY) 102 if (M_LIBRARY)
105 list(APPEND LIBRARIES ${M_LIBRARY}) 103 list(APPEND LIBRARIES ${M_LIBRARY})
106 endif () 104 endif ()
107 105
108 mlk_library( 106 mlk_library(
109 NAME libmlk-core 107 NAME libmlk-core
110 SOURCES ${SOURCES} ${NLS} 108 SOURCES ${HEADERS} ${NLS} ${SOURCES}
109 HEADERS ${HEADERS}
110 HEADERS_DIRECTORY mlk/core
111 LANGS ${NLS} 111 LANGS ${NLS}
112 INSTALL
112 LIBRARIES 113 LIBRARIES
113 PUBLIC 114 PUBLIC
114 ${LIBRARIES} 115 ${LIBRARIES}
115 ${OPENAL_LIBRARY} 116 ${OPENAL_LIBRARY}
116 SndFile::SndFile 117 SndFile::SndFile
118 SDL2::image 119 SDL2::image
119 SDL2::ttf 120 SDL2::ttf
120 libmlk-util 121 libmlk-util
121 INCLUDES 122 INCLUDES
122 PUBLIC 123 PUBLIC
124 $<BUILD_INTERFACE:${libmlk-core_SOURCE_DIR}>
123 ${OPENAL_INCLUDE_DIR} 125 ${OPENAL_INCLUDE_DIR}
124 $<BUILD_INTERFACE:${libmlk-core_SOURCE_DIR}>
125 ) 126 )
126 127
127 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${SOURCES} ${NLS}) 128 source_group(TREE ${libmlk-core_SOURCE_DIR} FILES ${SOURCES} ${NLS})