diff options
author | Gerald Combs <gerald@zing.org> | 2015-02-01 13:56:39 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-02-01 22:51:49 +0000 |
commit | 2cae3201b7353ebef07cb8b07e8efd7c4bcb1842 (patch) | |
tree | 247dce1908bc21656ff91fd18795eb71be816fdf /CMakeLists.txt | |
parent | 3947091a50e615b8414b086652ef92713bcf2889 (diff) |
CMake: Build a complete application bundle on OS X.
Run osx-app.sh by default on OS X. Aside from giving us a fully portable
application bundle after building this should let us clear our library
path at startup should the need arise. Change the name of the osx-app
target to app_bundle.
Search ../Frameworks before ../lib. Create PkgInfo at configure time
instead of compile time. Build our program list as we go.
Change-Id: If5511ee921108b1c079cef67026eac9e47211be1
Reviewed-on: https://code.wireshark.org/review/6896
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e9f925ca..48b9140774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -639,7 +639,7 @@ if(ENABLE_HTML_GUIDES) set(PACKAGELIST ${PACKAGELIST} DOXYGEN) endif() -set(PROGLIST text2pcap mergecap capinfos captype editcap reordercap dumpcap) +set(PROGLIST) #Sort the package list list(SORT PACKAGELIST) @@ -1477,7 +1477,8 @@ if(ENABLE_APPLICATION_BUNDLE) # with a static version installed in /usr/local/lib rather than # the system version in /usr/lib). # - # Also add -Wl,-rpath,@executable_path/../lib and + # Also add -Wl,-rpath,@executable_path/../Frameworks, + # -Wl,-rpath,@executable_path/../lib and # -Wl,-rpath,/usr/local/lib, so that, if we build an app # bundle, we can tweak all the executable images, shared # libraries, and plugins in the bundle to look for non-system @@ -1486,11 +1487,12 @@ if(ENABLE_APPLICATION_BUNDLE) # set(CMAKE_EXE_LINKER_FLAGS - "-Wl,-headerpad_max_install_names -Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/usr/local/lib ${CMAKE_EXE_LINKER_FLAGS}" + "-Wl,-headerpad_max_install_names -Wl,-search_paths_first -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,@executable_path/../lib -Wl,-rpath,/usr/local/lib ${CMAKE_EXE_LINKER_FLAGS}" ) # Add files to the app bundle # Wireshark.app/Contents + file(WRITE ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo "APPLWshk\n") set(BUNDLE_CONTENTS_FILES ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo ) @@ -1554,11 +1556,13 @@ if(BUILD_wireshark AND QT_FOUND) endif() add_executable(wireshark MACOSX_BUNDLE wireshark-qt.cpp ${wireshark_FILES} ${EXTRA_BUNDLE_FILES}) + set(PROGLIST ${PROGLIST} wireshark) set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") set_target_properties(wireshark PROPERTIES FOLDER "Executables") if(ENABLE_APPLICATION_BUNDLE OR WIN32) set_target_properties(wireshark PROPERTIES OUTPUT_NAME Wireshark) endif() + if(ENABLE_APPLICATION_BUNDLE) set_target_properties( wireshark PROPERTIES @@ -1630,6 +1634,8 @@ macro(set_extra_executable_properties _executable _folder) FOLDER ${_folder} ) + set(PROGLIST ${PROGLIST} ${_executable}) + if(ENABLE_APPLICATION_BUNDLE) set_target_properties(${_executable} PROPERTIES RUNTIME_OUTPUT_DIRECTORY run/Wireshark.app/Contents/MacOS @@ -1665,6 +1671,7 @@ if(BUILD_wireshark_gtk AND GTK_FOUND) # wireshark and wireshark-gtk share wireshark_FILES add_executable(wireshark-gtk ${wireshark_FILES}) + set(PROGLIST ${PROGLIST} wireshark-gtk) set_target_properties(wireshark-gtk PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") set_target_properties(wireshark-gtk PROPERTIES FOLDER "Executables") target_link_libraries(wireshark-gtk ${wireshark_gtk_LIBS}) @@ -2060,15 +2067,14 @@ ADD_CUSTOM_COMMAND( endif() if(ENABLE_APPLICATION_BUNDLE) -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo - COMMAND ${CMAKE_COMMAND} -E echo APPLWshk > ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo -) - -ADD_CUSTOM_TARGET(osx-app - COMMAND ${CMAKE_SOURCE_DIR}/packaging/macosx/osx-app.sh - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run -) + add_custom_target(app_bundle ALL) + set_target_properties(app_bundle PROPERTIES FOLDER "Copy Tasks") + add_custom_command(TARGET app_bundle + POST_BUILD + COMMAND "${CMAKE_SOURCE_DIR}/packaging/macosx/osx-app.sh" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run" + ) + add_dependencies(app_bundle ${PROGLIST}) endif() pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 ) |