A few build fixes for the mac os with cmake.

This commit is contained in:
mjbudd77 2020-07-10 14:48:46 -04:00
parent 9b0fb8efe4
commit cc4ce19784
2 changed files with 15 additions and 11 deletions

View File

@ -52,9 +52,9 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \ -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
.. .. || exit 1
make make || exit 1
make install make install || exit 1
# Debug via ssh if necessary # Debug via ssh if necessary
if [ ! -z $APPVEYOR_SSH_BLOCK ]; then if [ ! -z $APPVEYOR_SSH_BLOCK ]; then

View File

@ -20,6 +20,8 @@ else(WIN32)
# Use the package PkgConfig to detect headers/library files # Use the package PkgConfig to detect headers/library files
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED) find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
find_package(OpenGL REQUIRED)
find_package(zlib REQUIRED)
add_definitions( ${Qt5Widgets_DEFINITIONS} ) add_definitions( ${Qt5Widgets_DEFINITIONS} )
include_directories( ${Qt5Widgets_INCLUDE_DIRS} ) include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
@ -33,18 +35,19 @@ else(WIN32)
add_definitions( -D_SYSTEM_MINIZIP ${MINIZIP_CFLAGS} ) add_definitions( -D_SYSTEM_MINIZIP ${MINIZIP_CFLAGS} )
endif() endif()
pkg_check_modules( GL gl) #pkg_check_modules( GL gl) # Use built in find package instead for OpenGL
# Check for OpenGL # Check for OpenGL
if ( ${GL_FOUND} ) if ( ${OPENGL_FOUND} )
add_definitions( ${GL_CFLAGS} ) include_directories( ${OPENGL_INCLUDE_DIR} )
endif() endif()
pkg_check_modules( ZLIB REQUIRED zlib) #pkg_check_modules( ZLIB REQUIRED zlib) # Use built in find package instead for zlib
# Check for zlib # Check for zlib
if ( ${ZLIB_FOUND} ) if ( ${ZLIB_FOUND} )
add_definitions( ${ZLIB_CFLAGS} ) #add_definitions( ${ZLIB_CFLAGS} )
include_directories( ${ZLIB_INCLUDE_DIRS} )
endif() endif()
# Check for SDL2 # Check for SDL2
@ -106,8 +109,9 @@ else(WIN32)
add_definitions( -DHAVE_ASPRINTF ) # What system wouldn't have this? add_definitions( -DHAVE_ASPRINTF ) # What system wouldn't have this?
if(APPLE) if(APPLE)
set( SYS_LIBS "-framework OpenGL" ) set( OPENGL_LDFLAGS "-framework OpenGL" )
else() else()
set( OPENGL_LDFLAGS ${OPENGL_LIBRARIES} )
set( SYS_LIBS -lrt -lpthread ) set( SYS_LIBS -lrt -lpthread )
endif() endif()
@ -394,9 +398,9 @@ add_executable( fceux ${SOURCES} )
target_link_libraries( fceux target_link_libraries( fceux
${Qt5Widgets_LIBRARIES} ${Qt5Widgets_LIBRARIES}
${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_LIBRARIES}
${GL_LDFLAGS} ${OPENGL_LDFLAGS}
${SDL2_LDFLAGS} ${SDL2_LDFLAGS}
${MINIZIP_LDFLAGS} ${ZLIB_LDFLAGS} ${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
${LUA_LDFLAGS} ${LUA_LDFLAGS}
${SYS_LIBS} ${SYS_LIBS}
) )