1
0
Fork 0

Clean up CMake library specification

The X11 libraries don't need to be specified when doing dynamic linking
This commit is contained in:
Yuri Kunde Schlesner 2014-12-13 20:02:22 -02:00
parent 1ee740898a
commit 06f31e8b47
3 changed files with 11 additions and 12 deletions

View File

@ -6,6 +6,7 @@ project(citra)
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes")
add_definitions(-pthread)
else()
# Silence deprecation warnings
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
@ -75,10 +76,6 @@ if (ENABLE_GLFW)
set(GLFW_LIBRARIES glfw3)
else()
if (NOT APPLE)
find_package(X11 REQUIRED)
endif()
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
endif()

View File

@ -12,22 +12,20 @@ set(HEADERS
create_directory_groups(${SRCS} ${HEADERS})
# NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable)
if (NOT X11_xf86vmode_LIB)
set(X11_xv86vmode_LIB Xxf86vm)
endif()
add_executable(citra ${SRCS} ${HEADERS})
target_link_libraries(citra core common video_core)
target_link_libraries(citra ${OPENGL_gl_LIBRARY} ${GLFW_LIBRARIES} inih)
if (UNIX)
target_link_libraries(citra -pthread)
endif()
if (APPLE)
target_link_libraries(citra iconv pthread ${COREFOUNDATION_LIBRARY})
target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY})
elseif (WIN32)
target_link_libraries(citra winmm)
else() # Unix
target_link_libraries(citra pthread rt)
target_link_libraries(citra ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
target_link_libraries(citra rt)
endif()
#install(TARGETS citra RUNTIME DESTINATION ${bindir})

View File

@ -60,6 +60,10 @@ add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
target_link_libraries(citra-qt core common video_core qhexedit)
target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS})
if (UNIX)
target_link_libraries(citra-qt -pthread)
endif()
if (APPLE)
target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY})
elseif (WIN32)