Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

demodularise #42

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 169 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

PROJECT(MacGitver)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

Expand Down Expand Up @@ -41,15 +40,181 @@ SET(UTILS_APP_NAME MacGitver)

RAD_DEFINE_VERSION(MACGITVER_CORE 0 0 1)

QT_PREPARE( Core Gui Widgets Xml WinMain )

INCLUDE_DIRECTORIES( BEFORE
${MACGITVER_LIBS_SOURCE_DIR}
${MACGITVER_SOURCE_DIR}
${MACGITVER_BINARY_DIR}
)

INCLUDE_DIRECTORIES( AFTER
# Ensure external libs are last
${HEAVEN_INCLUDE_DIRS}
${GITWRAP_INCLUDE_DIRS}
)

ADD_SUBDIRECTORY(CfgComp)

ADD_SUBDIRECTORY(Libs)
ADD_SUBDIRECTORY(Main)
ADD_SUBDIRECTORY(Ui)
ADD_SUBDIRECTORY(Modules)

ADD_SUBDIRECTORY(AddOns)

ADD_SUBDIRECTORY(testMacGitverCore)

INCLUDE(InstallRequiredSystemLibraries)
SET( SRC_FILES
Main/main.cpp
)

SET( RCC_FILES
Main/MacGitver.rcc
)

QT_RCC( RCC_DATA QRC_FILES ${RCC_FILES} )

IF(APPLE)
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.macgitver")
SET(MACOSX_BUNDLE_BUNDLE_NAME "MacGitver")
#SET(MACOSX_BUNDLE_NSMAIN_NIB_FILE "MainMenu")
SET(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication")

SET(RES_DIR ${CMAKE_BINARY_DIR}/MacGitver.app/Contents/Resources)
FILE(MAKE_DIRECTORY ${RES_DIR})
SET(ICNS_FILE ${RES_DIR}/MacGitver.icns)

ADD_CUSTOM_COMMAND(
OUTPUT ${ICNS_FILE}
COMMAND iconutil -c icns -o ${ICNS_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/Main/MGV.iconset
)
ENDIF()

ADD_QT_EXECUTABLE(
MacGitver

MACOSX_BUNDLE
WIN32

${SRC_FILES}
${QRC_FILES}
${RCC_DATA}
Main/Info-CMake.plist
${ICNS_FILE}
)

SET_TARGET_PROPERTIES(
MacGitver
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Main/Info-CMake.plist
)

TARGET_LINK_LIBRARIES(
MacGitver

LINK_PRIVATE
GitWrap
MacGitverCore
)

#--------------------------------------------------------------------------------
# installation stuff below
#--------------------------------------------------------------------------------

INSTALL(
TARGETS MacGitver
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
LIBRARY DESTINATION lib COMPONENT Runtime
)

IF( APPLE OR WIN32 )
# directories to look for dependencies
SET( DIRS ${QT_LIBRARY_DIR} )

IF( APPLE )
SET( CPACK_BUNDLE_NAME "MacGitver-v0.1.0" )

LIST( APPEND DIRS "${CMAKE_BINARY_DIR}/MacGitver.app/Contents/Frameworks" )

SET(plugin_dest_dir MacGitver.app/Contents/MacOS)
SET(qtconf_dest_dir MacGitver.app/Contents/Resources)
SET(APPS "\${CMAKE_INSTALL_PREFIX}/MacGitver.app")

SET_TARGET_PROPERTIES( MacGitver
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)

ELSEIF( WIN32 )

LIST( APPEND DIRS "${CMAKE_BINARY_DIR}/bin" )

SET(plugin_dest_dir bin )
SET(qtconf_dest_dir bin )
SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MacGitver.exe")

SET_TARGET_PROPERTIES( MacGitver
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

ENDIF()

INSTALL(
DIRECTORY ${QT_PLUGINS_DIR}/imageformats
DESTINATION ${plugin_dest_dir}/plugins/imageformats
COMPONENT Runtime
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATTERN "*d4${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
)

INSTALL(
DIRECTORY ${QT_PLUGINS_DIR}/codecs
DESTINATION ${plugin_dest_dir}/plugins/codecs
COMPONENT Runtime
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATTERN "*d4${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
)

INSTALL(
DIRECTORY ${QT_PLUGINS_DIR}/iconengines
DESTINATION ${plugin_dest_dir}/plugins/iconengines
COMPONENT Runtime
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATTERN "*d4${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE
)

INSTALL(CODE "
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"\")
" COMPONENT Runtime)

#--------------------------------------------------------------------------------
# Use BundleUtilities to get all other dependencies for the application to work.
# It takes a bundle or executable along with possible plugins and inspects it
# for dependencies. If they are not system dependencies, they are copied.


INSTALL( CODE "
CMAKE_POLICY( SET CMP0011 NEW )
CMAKE_POLICY( SET CMP0009 NEW )
file(GLOB_RECURSE PLUGINS
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\"
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.mgv\")
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\${PLUGINS}\" \"${DIRS}\")
" COMPONENT Runtime
)

ELSEIF( UNIX )
# On unix we insall libraries to libexec/macgitver and executables to bin.
# That means, each excutable needs the "$ORIGIN/../libexec/{app}" r-path.

SET_TARGET_PROPERTIES( MacGitver
PROPERTIES INSTALL_RPATH "\$ORIGIN/../libexec/MacGitver:\$ORIGIN/../lib"
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

ENDIF()

INCLUDE(InstallRequiredSystemLibraries)
174 changes: 0 additions & 174 deletions Main/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ INCLUDE_DIRECTORIES(
${HEAVEN_INCLUDE_DIRS}
)

ADD_SUBDIRECTORY(Repository)
ADD_SUBDIRECTORY(Welcome)
ADD_SUBDIRECTORY(Logging)
ADD_SUBDIRECTORY(RepoManLogger)
1 change: 1 addition & 0 deletions Ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ADD_SUBDIRECTORY(Repository)
Loading