@@ -98,140 +98,6 @@ endif()
9898SET_CEF_TARGET_OUT_DIR ()
9999
100100
101- #
102- # Linux configuration.
103- #
104-
105- if (OS_LINUX)
106- # Executable target.
107- add_executable (${CEF_TARGET} ${CEFSIMPLE_SRCS} )
108- SET_EXECUTABLE_TARGET_PROPERTIES (${CEF_TARGET} )
109- add_dependencies (${CEF_TARGET} ak_cred_provider )
110- target_link_libraries (${CEF_TARGET} libcef_lib ak_cred_provider ${CEF_STANDARD_LIBS} )
111-
112- # Set rpath so that libraries can be placed next to the executable.
113- set_target_properties (${CEF_TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN" )
114- set_target_properties (${CEF_TARGET} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE )
115- set_target_properties (${CEF_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR} )
116-
117- # Copy binary and resource files to the target output directory.
118- COPY_FILES ("${CEF_TARGET} " "${CEF_BINARY_FILES} " "${CEF_BINARY_DIR } " "${CEF_TARGET_OUT_DIR} " )
119- COPY_FILES ("${CEF_TARGET} " "${CEF_RESOURCE_FILES} " "${CEF_RESOURCE_DIR} " "${CEF_TARGET_OUT_DIR} " )
120- if (EXISTS "${CEF_BINARY_DIR } /libminigbm.so" )
121- COPY_FILES ("${CEF_TARGET} " "libminigbm.so" "${CEF_BINARY_DIR } " "${CEF_TARGET_OUT_DIR} " )
122- endif ()
123-
124- # Set SUID permissions on the chrome-sandbox target.
125- SET_LINUX_SUID_PERMISSIONS ("${CEF_TARGET} " "${CEF_TARGET_OUT_DIR} /chrome-sandbox" )
126- endif ()
127-
128-
129- #
130- # Mac OS X configuration.
131- #
132-
133- if (OS_MAC)
134- option (OPTION_USE_ARC "Build with ARC (automatic Reference Counting) on macOS." ON )
135- if (OPTION_USE_ARC)
136- list (APPEND CEF_COMPILER_FLAGS
137- -fobjc-arc
138- )
139- set_target_properties (${target} PROPERTIES
140- CLANG_ENABLE_OBJC_ARC "YES"
141- )
142- endif ()
143-
144- # Output path for the main app bundle.
145- set (CEF_APP "${CEF_TARGET_OUT_DIR} /${CEF_TARGET} .app" )
146-
147- # Variables referenced from the main Info.plist file.
148- set (EXECUTABLE_NAME "${CEF_TARGET} " )
149- set (PRODUCT_NAME "${CEF_TARGET} " )
150-
151- if (USE_SANDBOX)
152- # Logical target used to link the cef_sandbox library.
153- ADD_LOGICAL_TARGET ("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG} " "${CEF_SANDBOX_LIB_RELEASE} " )
154- endif ()
155-
156- # Main app bundle target.
157- add_executable (${CEF_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_RESOURCES_SRCS} ${CEFSIMPLE_SRCS} )
158- SET_EXECUTABLE_TARGET_PROPERTIES (${CEF_TARGET} )
159- add_dependencies (${CEF_TARGET} ak_cred_provider )
160- target_link_libraries (${CEF_TARGET} ak_cred_provider ${CEF_STANDARD_LIBS} )
161- set_target_properties (${CEF_TARGET} PROPERTIES
162- MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR } /mac/Info.plist.in
163- )
164-
165- # Copy the CEF framework into the Frameworks directory.
166- add_custom_command (
167- TARGET ${CEF_TARGET}
168- POST_BUILD
169- COMMAND ${CMAKE_COMMAND } -E copy_directory
170- "${CEF_BINARY_DIR } /Chromium Embedded Framework.framework"
171- "${CEF_APP} /Contents/Frameworks/Chromium Embedded Framework.framework"
172- VERBATIM
173- )
174-
175- # Create the multiple Helper app bundle targets.
176- foreach (_suffix_list ${CEF_HELPER_APP_SUFFIXES} )
177- # Convert to a list and extract the suffix values.
178- string (REPLACE ":" ";" _suffix_list ${_suffix_list} )
179- list (GET _suffix_list 0 _name_suffix)
180- list (GET _suffix_list 1 _target_suffix)
181- list (GET _suffix_list 2 _plist_suffix)
182-
183- # Define Helper target and output names.
184- set (_helper_target "${CEF_HELPER_TARGET}${_target_suffix} " )
185- set (_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix} " )
186-
187- # Create Helper-specific variants of the helper-Info.plist file. Do this
188- # manually because the configure_file command (which is executed as part of
189- # MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the
190- # wrong values with multiple targets.
191- set (_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR } /helper-Info${_target_suffix} .plist" )
192- file (READ "${CMAKE_CURRENT_SOURCE_DIR } /mac/helper-Info.plist.in" _plist_contents )
193- string (REPLACE "\$ {EXECUTABLE_NAME}" "${_helper_output_name} " _plist_contents ${_plist_contents} )
194- string (REPLACE "\$ {PRODUCT_NAME}" "${_helper_output_name} " _plist_contents ${_plist_contents} )
195- string (REPLACE "\$ {BUNDLE_ID_SUFFIX}" "${_plist_suffix} " _plist_contents ${_plist_contents} )
196- file (WRITE ${_helper_info_plist} ${_plist_contents} )
197-
198- # Create Helper executable target.
199- add_executable (${_helper_target} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS} )
200- SET_EXECUTABLE_TARGET_PROPERTIES (${_helper_target} )
201- add_dependencies (${_helper_target} ak_cred_provider )
202- target_link_libraries (${_helper_target} ak_cred_provider ${CEF_STANDARD_LIBS} )
203- set_target_properties (${_helper_target} PROPERTIES
204- MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
205- OUTPUT_NAME ${_helper_output_name}
206- )
207-
208- if (USE_SANDBOX)
209- target_link_libraries (${_helper_target} cef_sandbox_lib )
210- endif ()
211-
212- # Add the Helper as a dependency of the main executable target.
213- add_dependencies (${CEF_TARGET} "${_helper_target} " )
214-
215- # Copy the Helper app bundle into the Frameworks directory.
216- add_custom_command (
217- TARGET ${CEF_TARGET}
218- POST_BUILD
219- COMMAND ${CMAKE_COMMAND } -E copy_directory
220- "${CEF_TARGET_OUT_DIR} /${_helper_output_name} .app"
221- "${CEF_APP} /Contents/Frameworks/${_helper_output_name} .app"
222- VERBATIM
223- )
224- endforeach ()
225-
226- # Manually process and copy over resource files.
227- # The Xcode generator can support this via the set_target_properties RESOURCE
228- # directive but that doesn't properly handle nested resource directories.
229- # Remove these prefixes from input file paths.
230- set (PREFIXES "mac/" )
231- COPY_MAC_RESOURCES ("${CEFSIMPLE_RESOURCES_SRCS} " "${PREFIXES} " "${CEF_TARGET} " "${CMAKE_CURRENT_SOURCE_DIR } " "${CEF_APP} " )
232- endif ()
233-
234-
235101#
236102# Windows configuration.
237103#
0 commit comments