Modernize CMake files
This commit is contained in:
parent
fc02cf004a
commit
ee08e18726
26 changed files with 259 additions and 275 deletions
|
@ -4,13 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/X11)
|
|||
# all source files
|
||||
set(SRC ${SRCROOT}/X11.cpp)
|
||||
|
||||
# find OpenGL and X11
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
find_package(X11 REQUIRED)
|
||||
include_directories(${X11_INCLUDE_DIR})
|
||||
|
||||
# define the X11 target
|
||||
sfml_add_example(X11 GUI_APP
|
||||
sfml_add_example(X11Example GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-window sfml-system ${OPENGL_LIBRARIES} ${X11_LIBRARIES})
|
||||
DEPENDS sfml-window OpenGL X11)
|
||||
|
|
|
@ -58,4 +58,4 @@ sfml_add_example(cocoa
|
|||
set_target_properties(cocoa PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST ${SRCROOT}/resources/Cocoa-Info.plist)
|
||||
target_link_libraries(cocoa "-framework Cocoa -framework Foundation")
|
||||
target_link_libraries(cocoa PRIVATE "-framework Cocoa" "-framework Foundation" sfml-graphics)
|
||||
|
|
|
@ -7,4 +7,4 @@ set(SRC ${SRCROOT}/Ftp.cpp)
|
|||
# define the ftp target
|
||||
sfml_add_example(ftp
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-network sfml-system)
|
||||
DEPENDS sfml-network)
|
||||
|
|
|
@ -4,13 +4,8 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/opengl)
|
|||
# all source files
|
||||
set(SRC ${SRCROOT}/OpenGL.cpp)
|
||||
|
||||
# find OpenGL
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
|
||||
# define the opengl target
|
||||
sfml_add_example(opengl GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-graphics sfml-window sfml-system ${ADDITIONAL_LIBRARIES}
|
||||
DEPENDS sfml-graphics OpenGL
|
||||
RESOURCES_DIR resources)
|
||||
|
|
|
@ -7,5 +7,5 @@ set(SRC ${SRCROOT}/Pong.cpp)
|
|||
# define the pong target
|
||||
sfml_add_example(pong GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-audio sfml-graphics sfml-window sfml-system
|
||||
DEPENDS sfml-audio sfml-graphics
|
||||
RESOURCES_DIR resources)
|
||||
|
|
|
@ -9,5 +9,5 @@ set(SRC
|
|||
# define the shader target
|
||||
sfml_add_example(shader GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-graphics sfml-window sfml-system
|
||||
DEPENDS sfml-graphics
|
||||
RESOURCES_DIR resources)
|
||||
|
|
|
@ -9,4 +9,4 @@ set(SRC ${SRCROOT}/Sockets.cpp
|
|||
# define the sockets target
|
||||
sfml_add_example(sockets
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-network sfml-system)
|
||||
DEPENDS sfml-network)
|
||||
|
|
|
@ -7,5 +7,5 @@ set(SRC ${SRCROOT}/Sound.cpp)
|
|||
# define the sound target
|
||||
sfml_add_example(sound
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-audio sfml-system
|
||||
DEPENDS sfml-audio
|
||||
RESOURCES_DIR resources)
|
||||
|
|
|
@ -7,4 +7,4 @@ set(SRC ${SRCROOT}/SoundCapture.cpp)
|
|||
# define the sound-capture target
|
||||
sfml_add_example(sound-capture
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-audio sfml-system)
|
||||
DEPENDS sfml-audio)
|
||||
|
|
|
@ -9,4 +9,4 @@ set(SRC ${SRCROOT}/VoIP.cpp
|
|||
# define the voip target
|
||||
sfml_add_example(voip
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-audio sfml-network sfml-system)
|
||||
DEPENDS sfml-audio sfml-network)
|
||||
|
|
|
@ -7,5 +7,5 @@ set(SRC ${SRCROOT}/Win32.cpp)
|
|||
# define the win32 target
|
||||
sfml_add_example(win32 GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-graphics sfml-window sfml-system
|
||||
DEPENDS sfml-graphics
|
||||
RESOURCES_DIR resources)
|
||||
|
|
|
@ -4,12 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/window)
|
|||
# all source files
|
||||
set(SRC ${SRCROOT}/Window.cpp)
|
||||
|
||||
# find OpenGL
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
|
||||
# define the window target
|
||||
sfml_add_example(window GUI_APP
|
||||
SOURCES ${SRC}
|
||||
DEPENDS sfml-window sfml-system ${ADDITIONAL_LIBRARIES})
|
||||
DEPENDS sfml-window OpenGL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue