daily pastebin goal
15%
SHARE
TWEET

minimal_sfml_cmakelists

a guest Mar 8th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.6)
  2.  
  3. project(myproject)
  4.  
  5. find_package(SFML 2 COMPONENTS graphics window system REQUIRED)
  6.  
  7. file(GLOB MYPROJECT_HEADERS include/*.hpp)
  8. file(GLOB MYPROJECT_SOURCES src/*.cpp)
  9.  
  10. add_executable(myproject ${MYPROJECT_HEADERS} ${MYPROJECT_SOURCES})
  11.  
  12. if (SFML_FOUND)
  13.   target_link_libraries(myproject sfml-window sfml-graphics sfml-system)
  14. endif()
  15.  
  16. target_include_directories(myproject
  17.     PUBLIC
  18.         $<INSTALL_INTERFACE:include>
  19.         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  20.     PRIVATE
  21.         ${CMAKE_CURRENT_SOURCE_DIR}/include
  22.         ${CMAKE_CURRENT_SOURCE_DIR}/src
  23. )
  24.  
  25. set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
  26. set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
  27. set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top