diff options
author | John Fultz <jfultz@wolfram.com> | 2019-07-19 12:16:43 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2019-07-19 12:16:43 -0500 |
commit | f9e9448738a5fae6f50223eb9905fc54fa4d8d1d (patch) | |
tree | cee58c30850bf940c9588e25fadcfd1da41eddcc /quacker | |
parent | 20fa14103552e05540a2943335a220f22766c90b (diff) |
First cut of a cmake build.
Building on macOS right now. cmake will soon replace qmake
as the supported build system. Some notes about the
implementation:
* libquackle and libquackleio can be separately built as before.
* quacker still links to the static libraries for libquackle and libquackleio,
but quacker's cmake file includes those projects, which means
everything builds at once. No more need to run separate builds
of everything to get a GUI. And debugging is easier now that
the libraries are incorporated into the quacker project.
* I tried to get cmake to build the macOS app bundle, but cmake
is unable, by conventional means, to build a non-flat Resources
directory (which many people have complained about). Right
now, the default build just builds the binary, and you have to run
it from the command-line. But -DBUNDLE=ON will build a shell
of a bundle. It won't work, but I intend to create an Xcode project
from it for building the bundle, to make it easier for me to deliver
a code-signed and notarized app bundle.
* I've got CMakeLists.txt files for the resources, but they're not
really doing anything right now. Maybe later.
* Minimum macOS version for the cmake build is 10.10.
Diffstat (limited to 'quacker')
-rw-r--r-- | quacker/CMakeLists.txt | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/quacker/CMakeLists.txt b/quacker/CMakeLists.txt new file mode 100644 index 0000000..f964f22 --- /dev/null +++ b/quacker/CMakeLists.txt @@ -0,0 +1,114 @@ +cmake_minimum_required (VERSION 3.10) + +project (Quackle VERSION 1.0.4) + +message("-- Configuring Quackle") + +include("${CMAKE_CURRENT_SOURCE_DIR}/../Settings.cmake") + +option(BUNDLE "Build app bundle on macOS; does not populate with resources" OFF) + +add_subdirectory(.. libquackle) +add_subdirectory(../quackleio quackleio) +add_subdirectory(../data data) + +find_package(Qt5 REQUIRED COMPONENTS Core Widgets) +set(CMAKE_AUTOMOC ON) + +set(QUACKLE_SOURCES + bagdisplay.cpp + boarddisplay.cpp + boardsetup.cpp + boardsetupdialog.cpp + brb.cpp + configdialog.cpp + configpages.cpp + dashboard.cpp + geometry.cpp + graphicalboard.cpp + graphicalreporter.cpp + history.cpp + letterbox.cpp + letterboxsettings.cpp + lexicondialog.cpp + lister.cpp + main.cpp + movebox.cpp + newgame.cpp + noteeditor.cpp + oppothread.cpp + oppothreadprogressbar.cpp + quacker.cpp + quackersettings.cpp + rackdisplay.cpp + settings.cpp + simviewer.cpp + view.cpp + widgetfactory.cpp +) + +set(QUACKLE_HEADERS + bagdisplay.h + boarddisplay.h + boardsetup.h + boardsetupdialog.h + brb.h + configdialog.h + configpages.h + customqsettings.h + dashboard.h + geometry.h + graphicalboard.h + graphicalreporter.h + history.h + letterbox.h + letterboxsettings.h + lexicondialog.h + lister.h + movebox.h + newgame.h + noteeditor.h + oppothread.h + oppothreadprogressbar.h + quacker.h + quackersettings.h + rackdisplay.h + settings.h + simviewer.h + view.h + widgetfactory.h +) + +set(QUACKLE_RESOURCES + quacker.icns + ${DATA_ALPHABETS} +) + +message( "${QUACKLE_RESOURCES} ${APPLE} $<1:abc>") +if(APPLE AND BUNDLE) + add_executable(Quackle + MACOSX_BUNDLE + ${QUACKLE_SOURCES} ${QUACKLE_HEADERS} quacker.rc + ) +else() + add_executable(Quackle + ${QUACKLE_SOURCES} ${QUACKLE_HEADERS} quacker.rc + ) +endif() + +target_link_libraries(Quackle quackleio libquackle) +target_link_libraries(Quackle Qt5::Core Qt5::Widgets) + +if(APPLE) + target_link_libraries(Quackle "-framework CoreFoundation") + set_target_properties(Quackle PROPERTIES + $<$<BOOL:${BUNDLE}>: + MACOSX_BUNDLE TRUE + RESOURCE "${QUACKLE_RESOURCES}" + > + ) +endif() + +set_target_properties(Quackle PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Quackle.plist") +set_target_properties(Quackle PROPERTIES COMPILE_FLAGS -fsanitize=address) +set_target_properties(Quackle PROPERTIES LINK_FLAGS -fsanitize=address) |