Update CMakeLists.txt files

This commit is contained in:
Jonas Kvinge 2020-04-23 20:59:09 +02:00
parent cb2bb4cb67
commit ac40094d37
9 changed files with 94 additions and 192 deletions

View File

@ -1,16 +1,8 @@
cmake_minimum_required(VERSION 2.8.11) cmake_minimum_required(VERSION 3.0)
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckFunctionExists) include(CheckFunctionExists)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
if(CMAKE_VERSION VERSION_GREATER 3.0) if(CMAKE_VERSION VERSION_GREATER 3.0)
check_function_exists(geteuid HAVE_GETEUID) check_function_exists(geteuid HAVE_GETEUID)
check_function_exists(getpwuid HAVE_GETPWUID) check_function_exists(getpwuid HAVE_GETPWUID)
@ -19,14 +11,15 @@ endif()
set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp) set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp)
set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h) set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h)
QT5_WRAP_CPP(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS}) QT5_WRAP_CPP(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
ADD_LIBRARY(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC}) add_library(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC})
target_link_libraries(singleapplication Qt5::Core Qt5::Widgets Qt5::Network) target_link_libraries(singleapplication Qt5::Core Qt5::Widgets Qt5::Network)
set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp) set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp)
set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h) set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h)
QT5_WRAP_CPP(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS}) QT5_WRAP_CPP(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
ADD_LIBRARY(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC}) add_library(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC})
target_link_libraries(singlecoreapplication Qt5::Core Qt5::Widgets Qt5::Network) target_link_libraries(singlecoreapplication Qt5::Core Qt5::Widgets Qt5::Network)
configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h") configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h")
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})

View File

@ -1,8 +1,4 @@
cmake_minimum_required(VERSION 2.8.11) cmake_minimum_required(VERSION 3.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -fpermissive -Wall -Woverloaded-virtual -Wno-sign-compare -Wno-delete-non-virtual-dtor")
set(TAGLIB_SOVERSION_CURRENT 17) set(TAGLIB_SOVERSION_CURRENT 17)
set(TAGLIB_SOVERSION_REVISION 0) set(TAGLIB_SOVERSION_REVISION 0)

View File

@ -1,24 +1,7 @@
# Strawberry Music Player
# Copyright 2013, Jonas Kvinge <jonas@strawbs.net>
#
# Strawberry is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Strawberry is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
project(strawberry) project(strawberry)
cmake_minimum_required(VERSION 2.8.11)
if(CMAKE_VERSION VERSION_GREATER 3.0) cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
endif()
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(CheckCXXSourceRuns) include(CheckCXXSourceRuns)
@ -32,6 +15,8 @@ include(cmake/Rpm.cmake)
include(cmake/Deb.cmake) include(cmake/Deb.cmake)
include(cmake/Dmg.cmake) include(cmake/Dmg.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX ON) set(LINUX ON)
endif() endif()
@ -42,8 +27,49 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
set(OPENBSD ON) set(OPENBSD ON)
endif() endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND COMPILE_OPTIONS
--std=c++11
-U__STRICT_ANSI__
-Wall
-Wextra
-Wpedantic
-Wunused
-Wshadow
-Wundef
-Wuninitialized
-Wredundant-decls
-Wcast-align
-Winit-self
-Woverloaded-virtual
-Wmissing-include-dirs
-Wmissing-declarations
-Wstrict-overflow=2
-Wunused-parameter
-Wduplicated-branches
-Wduplicated-cond
-Wformat=2
-Wdisabled-optimization
-Wunsafe-loop-optimizations
-Wno-sign-conversion
-Wno-old-style-cast
-fpermissive
)
if(APPLE)
list(APPEND COMPILE_OPTIONS -Wno-unused-parameter)
endif()
option(BUILD_WERROR "Build with -Werror" ON)
if(BUILD_WERROR)
list(APPEND COMPILE_OPTIONS -Werror)
endif(BUILD_WERROR)
message(STATUS "COMPILE_OPTIONS: ${COMPILE_OPTIONS}")
add_compile_options(${COMPILE_OPTIONS})
if(${CMAKE_BUILD_TYPE} MATCHES "Release") if(${CMAKE_BUILD_TYPE} MATCHES "Release")
add_definitions(-DNDEBUG) add_definitions(-DNDEBUG)
@ -175,11 +201,10 @@ pkg_check_modules(TAGLIB taglib)
# - Audio file detection by content. # - Audio file detection by content.
# - DSF and DSDIFF support # - DSF and DSDIFF support
# #
if (TAGLIB_VERSION VERSION_GREATER 1.11.1) # Some distros create their own version numbers for taglib so versions are not reliable anymore.
option(USE_SYSTEM_TAGLIB "Use system taglib" ON) # Force to use our own copy of taglib unless USE_SYSTEM_TAGLIB is set.
else()
option(USE_SYSTEM_TAGLIB "Use system taglib" OFF) option(USE_SYSTEM_TAGLIB "Use system taglib" OFF)
endif()
if (TAGLIB_FOUND AND USE_SYSTEM_TAGLIB) if (TAGLIB_FOUND AND USE_SYSTEM_TAGLIB)
if (TAGLIB_VERSION VERSION_GREATER 1.11.1) if (TAGLIB_VERSION VERSION_GREATER 1.11.1)
message(STATUS "Using system taglib library") message(STATUS "Using system taglib library")
@ -388,17 +413,14 @@ if(HAVE_XINE)
XINE_ANALYZER) XINE_ANALYZER)
endif() endif()
# Set up definitions and paths # Set up definitions
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS) add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
add_definitions(${QT_DEFINITIONS}) add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_STRICT_ITERATORS)
add_definitions(-DQT_USE_QSTRINGBUILDER) add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS) add_definitions(-DQT_NO_CAST_TO_ASCII)
include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
include_directories(${TAGLIB_INCLUDE_DIRS})
# Subdirectories # Subdirectories
add_subdirectory(src) add_subdirectory(src)

View File

@ -1,15 +1,6 @@
cmake_minimum_required(VERSION 2.8.11) cmake_minimum_required(VERSION 3.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${GLIB_INCLUDE_DIRS}) include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${GOBJECT_INCLUDE_DIRS}) include_directories(${GOBJECT_INCLUDE_DIRS})
include_directories(${GSTREAMER_INCLUDE_DIRS}) include_directories(${GSTREAMER_INCLUDE_DIRS})

View File

@ -1,13 +1,7 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(${CMAKE_SOURCE_DIR}/src)
@ -17,6 +11,8 @@ if (Backtrace_FOUND)
include_directories(${Backtrace_INCLUDE_DIRS}) include_directories(${Backtrace_INCLUDE_DIRS})
endif(Backtrace_FOUND) endif(Backtrace_FOUND)
include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${PROTOBUF_INCLUDE_DIRS})
set(SOURCES set(SOURCES
@ -41,18 +37,11 @@ endif(APPLE)
qt5_wrap_cpp(MOC ${HEADERS}) qt5_wrap_cpp(MOC ${HEADERS})
add_library(libstrawberry-common STATIC add_library(libstrawberry-common STATIC ${SOURCES} ${MOC})
${SOURCES}
${MOC}
)
if (Backtrace_FOUND) if(Backtrace_FOUND)
target_link_libraries(libstrawberry-common ${Backtrace_LIBRARIES}) target_link_libraries(libstrawberry-common ${Backtrace_LIBRARIES})
endif (Backtrace_FOUND) endif(Backtrace_FOUND)
target_link_libraries(libstrawberry-common
${TAGLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
target_link_libraries(libstrawberry-common ${TAGLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(libstrawberry-common Qt5::Core Qt5::Network) target_link_libraries(libstrawberry-common Qt5::Core Qt5::Network)

View File

@ -1,10 +1,4 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
@ -13,30 +7,12 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR}/src) include_directories(${CMAKE_BINARY_DIR}/src)
include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${TAGLIB_INCLUDE_DIRS})
set(MESSAGES set(MESSAGES tagreadermessages.proto)
tagreadermessages.proto set(SOURCES fmpsparser.cpp tagreader.cpp)
)
set(SOURCES
fmpsparser.cpp
tagreader.cpp
)
set(HEADERS
)
qt5_wrap_cpp(MOC ${HEADERS})
protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES}) protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})
add_library(libstrawberry-tagreader STATIC add_library(libstrawberry-tagreader STATIC ${PROTO_SOURCES} ${SOURCES})
${PROTO_SOURCES} target_link_libraries(libstrawberry-tagreader ${PROTOBUF_LIBRARY} libstrawberry-common)
${SOURCES}
${MOC}
)
target_link_libraries(libstrawberry-tagreader
${PROTOBUF_LIBRARY}
libstrawberry-common
)

View File

@ -1,4 +1,5 @@
include_directories(${PROTOBUF_INCLUDE_DIRS}) cmake_minimum_required(VERSION 3.0)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common) include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common)
@ -7,29 +8,17 @@ include_directories(${CMAKE_BINARY_DIR}/ext/libstrawberry-tagreader)
include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_BINARY_DIR}/src) include_directories(${CMAKE_BINARY_DIR}/src)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") include_directories(${PROTOBUF_INCLUDE_DIRS})
set(CMAKE_CXX_STANDARD 11) include_directories(${TAGLIB_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(SOURCES set(SOURCES main.cpp tagreaderworker.cpp)
main.cpp
tagreaderworker.cpp
)
qt5_wrap_cpp(MOC ${HEADERS}) qt5_wrap_cpp(MOC ${HEADERS})
qt5_add_resources(QRC data/data.qrc) qt5_add_resources(QRC data/data.qrc)
add_executable(strawberry-tagreader add_executable(strawberry-tagreader ${SOURCES} ${MOC} ${QRC})
${SOURCES}
${MOC}
${QRC}
)
target_link_libraries(strawberry-tagreader target_link_libraries(strawberry-tagreader
${TAGLIB_LIBRARIES} ${TAGLIB_LIBRARIES}
@ -40,16 +29,11 @@ target_link_libraries(strawberry-tagreader
) )
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(strawberry-tagreader target_link_libraries(strawberry-tagreader execinfo)
execinfo
)
endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
if(APPLE) if(APPLE)
target_link_libraries(strawberry-tagreader target_link_libraries(strawberry-tagreader /System/Library/Frameworks/Foundation.framework)
/System/Library/Frameworks/Foundation.framework
)
endif(APPLE) endif(APPLE)
install(TARGETS strawberry-tagreader RUNTIME DESTINATION bin) install(TARGETS strawberry-tagreader RUNTIME DESTINATION bin)

View File

@ -1,49 +1,16 @@
# Strawberry Music Player cmake_minimum_required(VERSION 3.0)
# Copyright 2013, Jonas Kvinge <jonas@strawbs.net>
#
# Strawberry is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Strawberry is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
endif()
option(BUILD_WERROR "Build with -Werror" OFF)
if(BUILD_WERROR)
if (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif (LINUX)
endif(BUILD_WERROR)
if(HAVE_TRANSLATIONS) if(HAVE_TRANSLATIONS)
include(../cmake/Translations.cmake) include(../cmake/Translations.cmake)
endif(HAVE_TRANSLATIONS) endif(HAVE_TRANSLATIONS)
# Set up definitions and paths include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common)
include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-tagreader)
include_directories(${CMAKE_BINARY_DIR}/ext/libstrawberry-tagreader)
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS})
include_directories(${GLIBCONFIG_INCLUDE_DIRS}) include_directories(${GLIBCONFIG_INCLUDE_DIRS})
include_directories(${GLIB_INCLUDE_DIRS}) include_directories(${GLIB_INCLUDE_DIRS})
@ -96,10 +63,6 @@ if(HAVE_LIBMTP)
include_directories(${LIBMTP_INCLUDE_DIRS}) include_directories(${LIBMTP_INCLUDE_DIRS})
endif(HAVE_LIBMTP) endif(HAVE_LIBMTP)
include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common)
include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-tagreader)
include_directories(${CMAKE_BINARY_DIR}/ext/libstrawberry-tagreader)
set(SOURCES set(SOURCES
core/mainwindow.cpp core/mainwindow.cpp
core/application.cpp core/application.cpp
@ -1077,11 +1040,7 @@ if(HAVE_AUDIOCD)
endif(HAVE_AUDIOCD) endif(HAVE_AUDIOCD)
if(HAVE_IMOBILEDEVICE) if(HAVE_IMOBILEDEVICE)
target_link_libraries(strawberry_lib target_link_libraries(strawberry_lib ${LIBIMOBILEDEVICE_LIBRARIES} ${LIBPLIST_LIBRARIES} ${LIBUSBMUXD_LIBRARIES})
${LIBIMOBILEDEVICE_LIBRARIES}
${LIBPLIST_LIBRARIES}
${LIBUSBMUXD_LIBRARIES}
)
link_directories(${LIBIMOBILEDEVICE_LIBRARY_DIRS}) link_directories(${LIBIMOBILEDEVICE_LIBRARY_DIRS})
link_directories(${LIBUSBMUXD_LIBRARY_DIRS}) link_directories(${LIBUSBMUXD_LIBRARY_DIRS})
endif(HAVE_IMOBILEDEVICE) endif(HAVE_IMOBILEDEVICE)
@ -1109,7 +1068,6 @@ if (APPLE)
"-framework ScriptingBridge" "-framework ScriptingBridge"
) )
target_link_libraries(strawberry_lib ${SPMEDIAKEYTAP_LIBRARIES})
if (HAVE_SPARKLE) if (HAVE_SPARKLE)
include_directories(${SPARKLE}/Headers) include_directories(${SPARKLE}/Headers)
target_link_libraries(strawberry_lib ${SPARKLE}) target_link_libraries(strawberry_lib ${SPARKLE})
@ -1132,9 +1090,9 @@ if (UNIX AND NOT APPLE)
endif () endif ()
endif () endif ()
if(NOT USE_SYSTEM_SINGLEAPPLICATION) if (NOT USE_SYSTEM_SINGLEAPPLICATION)
add_dependencies(strawberry_lib ${SINGLEAPPLICATION_LIBRARIES} ${SINGLECOREAPPLICATION_LIBRARIES}) add_dependencies(strawberry_lib ${SINGLEAPPLICATION_LIBRARIES} ${SINGLECOREAPPLICATION_LIBRARIES})
endif() endif ()
############################################################################### ###############################################################################
@ -1162,9 +1120,7 @@ if(FREEBSD)
target_link_libraries(strawberry execinfo) target_link_libraries(strawberry execinfo)
endif() endif()
target_link_libraries(strawberry target_link_libraries(strawberry strawberry_lib)
strawberry_lib
)
# macdeploy.py relies on the blob being built first. # macdeploy.py relies on the blob being built first.
add_dependencies(strawberry strawberry-tagreader) add_dependencies(strawberry strawberry-tagreader)

View File

@ -1,7 +1,3 @@
cmake_minimum_required(VERSION 2.8.11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fpermissive -Wno-c++11-narrowing -U__STRICT_ANSI__")
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS Test) find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS Test)
find_package(GTest) find_package(GTest)
find_library(GMOCK_LIBRARY gmock) find_library(GMOCK_LIBRARY gmock)
@ -79,8 +75,7 @@ if(Qt5Test_FOUND AND GTEST_FOUND AND GMOCK_LIBRARY)
set_target_properties(${TEST_NAME} PROPERTIES COMPILE_FLAGS "-Wno-bool-conversions") set_target_properties(${TEST_NAME} PROPERTIES COMPILE_FLAGS "-Wno-bool-conversions")
endif (SUPPORTS_NOBOOL) endif (SUPPORTS_NOBOOL)
add_custom_command(TARGET strawberry_test POST_BUILD add_custom_command(TARGET strawberry_test POST_BUILD COMMAND ./${TEST_NAME}${CMAKE_EXECUTABLE_SUFFIX})
COMMAND ./${TEST_NAME}${CMAKE_EXECUTABLE_SUFFIX})
add_dependencies(build_tests ${TEST_NAME}) add_dependencies(build_tests ${TEST_NAME})
endmacro (add_test_file) endmacro (add_test_file)