Skip to content

Commit

Permalink
Merge pull request #22 from Lukas-W/stable-0.4
Browse files Browse the repository at this point in the history
Fix build problems: Find wine and freetype headers
  • Loading branch information
tobydox committed Jan 15, 2014
2 parents 31e712a + 22ca7ac commit 14e6b71
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
22 changes: 4 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,13 @@ ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)

# check for WINE
IF(WANT_VST)
INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFileCXX)
SET(CMAKE_REQUIRED_FLAGS_ORIG ${CMAKE_REQUIRED_FLAGS})
SET(CMAKE_REQUIRED_INCLUDES_ORIG ${CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_CXX_COMPILER_ORIG ${CMAKE_CXX_COMPILER})
IF(LMMS_HOST_X86_64)
SET(CMAKE_REQUIRED_FLAGS -m32 ${CMAKE_REQUIRED_FLAGS})
ENDIF(LMMS_HOST_X86_64)
CHECK_LIBRARY_EXISTS(wine wine_init "" HAVE_LIBWINE)
SET(CMAKE_CXX_COMPILER /usr/bin/wineg++)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include/wine/windows /usr/include/wine/windows)
CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_ORIG})
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_ORIG})
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_ORIG})
IF(HAVE_LIBWINE AND HAVE_WINDOWS_H)
FIND_PACKAGE(Wine)
IF(WINE_FOUND)
SET(LMMS_SUPPORT_VST TRUE)
SET(STATUS_VST "OK")
ELSE(HAVE_LIBWINE AND HAVE_WINDOWS_H)
ELSE(WINE_FOUND)
SET(STATUS_VST "not found, please install (lib)wine-dev (or similiar) - 64 bit systems additionally need gcc-multilib and g++-multilib")
ENDIF(HAVE_LIBWINE AND HAVE_WINDOWS_H)
ENDIF(WINE_FOUND)
ENDIF(WANT_VST)
IF(LMMS_BUILD_WIN32)
SET(LMMS_SUPPORT_VST TRUE)
Expand Down
19 changes: 19 additions & 0 deletions cmake/modules/FindWine.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# - Try to find the wine libraries
# Once done this will define
#
# WINE_FOUND - System has wine
# WINE_INCLUDE_DIRS - The wine include directories
# WINE_LIBRARIES - The libraries needed to use wine
# WINE_DEFINITIONS - Compiler switches required for using wine
#

FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATH_SUFFIXES wine)
FIND_LIBRARY(WINE_LIBRARY NAMES wine)

set(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
set(WINE_LIBRARIES ${WINE_LIBRARY} )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_LIBRARIES WINE_INCLUDE_DIRS)

mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY)
2 changes: 1 addition & 1 deletion plugins/zynaddsubfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ IF(LMMS_BUILD_WIN64)
ELSEIF(LMMS_BUILD_WIN32)
SET(FLTK_EXTRA_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/modules/Win32Toolchain.cmake")
ENDIF(LMMS_BUILD_WIN64)
ADD_CUSTOM_TARGET(libfltk COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/fltk && cd ${CMAKE_CURRENT_BINARY_DIR}/fltk && ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/fltk ${FLTK_EXTRA_FLAGS} -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake/modules/ -DFLTK_USE_SYSTEM_ZLIB:BOOL=ON -DFLTK_USE_SYSTEM_JPEG:BOOL=ON -DFLTK_USE_SYSTEM_PNG:BOOL=ON -DOPTION_BUILD_EXAMPLES:BOOL=OFF -DCMAKE_BUILD_TYPE=release && ${CMAKE_BUILD_TOOL})
ADD_CUSTOM_TARGET(libfltk COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/fltk && cd ${CMAKE_CURRENT_BINARY_DIR}/fltk && ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/fltk ${FLTK_EXTRA_FLAGS} -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake/modules/ -DFLTK_USE_SYSTEM_ZLIB:BOOL=ON -DFLTK_USE_SYSTEM_JPEG:BOOL=ON -DFLTK_USE_SYSTEM_PNG:BOOL=ON -DOPTION_BUILD_EXAMPLES:BOOL=OFF -DCMAKE_BUILD_TYPE=release -DFREETYPE_PATH=${FREETYPE_INCLUDE_DIR_ft2build} && ${CMAKE_BUILD_TOOL})

ADD_DEPENDENCIES(RemoteZynAddSubFx libfltk)

0 comments on commit 14e6b71

Please sign in to comment.