@@ -38,14 +38,6 @@ else()
3838 set (OUTPUT_NAME "${OUTPUT_NAME} -unknown" )
3939endif ()
4040
41- # +-------------------------------------------------------------------------------------------------------+
42- # | Library switches |
43- # +-------------------------------------------------------------------------------------------------------+
44-
45- option (saucer_desktop "Enable support for the desktop module" ON )
46- option (saucer_pdf "Enable support for the pdf module" OFF )
47- option (saucer_loop "Enable support for the loop module" ON )
48-
4941# +-------------------------------------------------------------------------------------------------------+
5042# | CMake options |
5143# +-------------------------------------------------------------------------------------------------------+
@@ -81,11 +73,13 @@ else()
8173endif ()
8274
8375if (PROJECT_IS_TOP_LEVEL AND NOT MSVC AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC" )
84- target_compile_options (${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
76+ target_compile_options (${PROJECT_NAME} PRIVATE
77+ -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
8578endif ()
8679
8780if (NOT MSVC )
88- target_compile_options (${PROJECT_NAME} PRIVATE -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-cast-function-type )
81+ target_compile_options (${PROJECT_NAME} PRIVATE
82+ -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-cast-function-type )
8983endif ()
9084
9185# +-------------------------------------------------------------------------------------------------------+
@@ -95,7 +89,7 @@ endif()
9589include ("cmake/hide.cmake" )
9690include ("cmake/export.cmake" )
9791
98- # saucer_bindings_hide_symbols(${PROJECT_NAME})
92+ saucer_bindings_hide_symbols(${PROJECT_NAME} )
9993saucer_bindings_export(${PROJECT_NAME} "SAUCER_EXPORT" )
10094
10195# +-------------------------------------------------------------------------------------------------------+
@@ -138,10 +132,10 @@ target_sources(${PROJECT_NAME} PRIVATE
138132include ("cmake/cpm.cmake" )
139133
140134CPMFindPackage(
141- NAME saucer
142- VERSION 8.0.2
143- GIT_REPOSITORY "https://github.com/saucer/saucer"
144- OPTIONS "saucer_static ON" "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON"
135+ NAME saucer
136+ VERSION 8.0.2
137+ GIT_REPOSITORY "https://github.com/saucer/saucer"
138+ OPTIONS "saucer_static ON" "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON"
145139)
146140
147141target_link_libraries (${PROJECT_NAME} PUBLIC saucer::saucer saucer::private )
@@ -151,11 +145,11 @@ target_link_libraries(${PROJECT_NAME} PUBLIC saucer::saucer saucer::private)
151145# +-------------------------------------------------------------------------------------------------------+
152146
153147if (saucer_backend STREQUAL "WebKit" )
154- enable_language (OBJCXX)
155- configure_file ("src/native.cpp" "${CMAKE_CURRENT_SOURCE_DIR} /src/native.mm" COPYONLY )
156- target_sources (${PROJECT_NAME} PRIVATE "src/native.mm" )
148+ enable_language (OBJCXX)
149+ configure_file ("src/native.cpp" "${CMAKE_CURRENT_SOURCE_DIR} /src/native.mm" COPYONLY )
150+ target_sources (${PROJECT_NAME} PRIVATE "src/native.mm" )
157151else ()
158- target_sources (${PROJECT_NAME} PRIVATE "src/native.cpp" )
152+ target_sources (${PROJECT_NAME} PRIVATE "src/native.cpp" )
159153endif ()
160154
161155# +-------------------------------------------------------------------------------------------------------+
@@ -164,14 +158,45 @@ endif()
164158
165159include ("cmake/module.cmake" )
166160
167- if (saucer_desktop)
168- add_subdirectory ("modules/desktop" )
169- endif ()
170161
171- if (saucer_pdf)
172- add_subdirectory ("modules/pdf" )
173- endif ()
162+ message (STATUS "Adding desktop module to main library" )
174163
175- if (saucer_loop)
176- add_subdirectory ("modules/loop" )
177- endif ()
164+ CPMFindPackage(
165+ NAME saucer-desktop
166+ VERSION 4.2.0
167+ GIT_REPOSITORY "https://github.com/saucer/desktop"
168+ )
169+
170+ target_sources (${PROJECT_NAME} PRIVATE
171+ "modules/desktop/src/desktop.cpp"
172+ )
173+
174+ target_include_directories (${PROJECT_NAME}
175+ PRIVATE "modules/desktop/include/saucer"
176+ PUBLIC "modules/desktop/include"
177+ )
178+
179+ target_link_libraries (${PROJECT_NAME} PRIVATE saucer::desktop)
180+ target_compile_definitions (${PROJECT_NAME} PRIVATE SAUCER_DESKTOP_EXPORT)
181+
182+
183+
184+ message (STATUS "Adding loop module to main library" )
185+
186+ CPMFindPackage(
187+ NAME saucer-loop
188+ VERSION 2.1.0
189+ GIT_REPOSITORY "https://github.com/saucer/loop"
190+ )
191+
192+ target_sources (${PROJECT_NAME} PRIVATE
193+ "modules/loop/src/loop.cpp"
194+ )
195+
196+ target_include_directories (${PROJECT_NAME}
197+ PRIVATE "modules/loop/include/saucer"
198+ PUBLIC "modules/loop/include"
199+ )
200+
201+ target_link_libraries (${PROJECT_NAME} PRIVATE saucer::loop)
202+ target_compile_definitions (${PROJECT_NAME} PRIVATE SAUCER_LOOP_EXPORT)
0 commit comments