From 9c10bdabf49a798d8c15509b4f96f4fa24bbeaf5 Mon Sep 17 00:00:00 2001 From: Thomas Frank Date: Thu, 29 Nov 2018 12:53:19 +0100 Subject: [PATCH] modified cmakelists for building on Mac OS --- .gitignore | 5 +++++ CMakeLists.txt | 20 ++++++++++++++++---- src/control/XournalMain.cpp | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9e40d861..47074e23 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,8 @@ src/pdf/popplerdirect/workaround/workaround.sh # NetBeans nbproject/ + +#CLion +.idea +cmake-build-debug +cmake-build-release diff --git a/CMakeLists.txt b/CMakeLists.txt index 451e7a33..b323b9c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,13 @@ include (GitRepo) include (C++11) CheckCXX11 (FATAL_ERROR) +## os specific library ending ## +if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(LIB_ENDING "dylib") +else () + set(LIB_ENDING "so") +endif () + ## Libraries ## macro (add_includes_ldflags LDFLAGS INCLUDES) @@ -116,6 +123,11 @@ if (LSB_RELEASE_ID_SHORT STREQUAL "Ubuntu" AND LSB_RELEASE_NUMBER_SHORT STREQUAL set(BUILD_POPPLER ON) message ("Automatically set BUILD_POPPLER ON on Ubuntu 16.04") endif() +## Mac OS X too +if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(BUILD_POPPLER ON) + message ("Automatically set BUILD_POPPLER ON on Mac OS") +endif () set (POPPLER_MIN_VER "0.58") set (POPPLER_MAX_VER "0.68") @@ -190,10 +202,10 @@ if (BUILD_POPPLER) "${POPPLER_PREFIX}/src/poppler-build/utils" ) set (POPPLER_LIBRARIES - libpoppler.so - libpoppler-cpp.so - libpoppler-glib.so - + "libpoppler.${LIB_ENDING}" + "libpoppler-cpp.${LIB_ENDING}" + "libpoppler-glib.${LIB_ENDING}" + ${OPENJPEG_LIBRARIES} # Comment out, seems to be a problem on Debian... # Do we need to detect something to enable / disable? diff --git a/src/control/XournalMain.cpp b/src/control/XournalMain.cpp index 6f074c7f..d24353e1 100644 --- a/src/control/XournalMain.cpp +++ b/src/control/XournalMain.cpp @@ -19,6 +19,7 @@ #include #include #include +#undef ENABLE_NLS namespace bf = boost::filesystem; #include