Advertisement
Guest User

Untitled

a guest
Jun 15th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 3.73 KB | None | 0 0
  1. cmake_minimum_required (VERSION 2.6)
  2. project (Relocate)
  3.  
  4. message("Using CMake version ${CMAKE_VERSION}")
  5. message("Processing CMakeLists.txt")
  6.  
  7. # Version number
  8. set (Relocate_VERSION_MAJOR 1)
  9. set (Relocate_VERSION_MINOR 0)
  10.  
  11. # configure a header file to pass some of the CMake settings
  12. # to the source code
  13. configure_file (
  14.   "${PROJECT_SOURCE_DIR}/Config.h.in"
  15.   "${PROJECT_BINARY_DIR}/Config.h"
  16.   )
  17.  
  18. # add the binary tree to the search path for include files
  19. # so that we will find Config.h
  20. include_directories("${PROJECT_BINARY_DIR}")
  21.  
  22. # Define sources and executable
  23. set(EXECUTABLE_NAME "Relocate")
  24. add_executable(${EXECUTABLE_NAME} main.cpp)
  25.  
  26. # Detect and add SFML
  27. set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
  28. #Find any version 2.X of SFML
  29. #See the FindSFML.cmake file for additional details and instructions
  30. find_package(SFML 2 REQUIRED network audio graphics window system)
  31. if(SFML_FOUND)
  32.   include_directories(${SFML_INCLUDE_DIR})
  33.   target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
  34. endif()
  35.  
  36. # Install target
  37. install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
  38.  
  39.  
  40. # CPack packaging
  41. include(InstallRequiredSystemLibraries)
  42. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
  43. set(CPACK_PACKAGE_VERSION_MAJOR "${myproject_VERSION_MAJOR}")
  44. set(CPACK_PACKAGE_VERSION_MINOR "${myproject_VERSION_MINOR}")
  45. include(CPack)
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  ashe@ArchTitan  ~/Documents/relocate   master  make
  53. [ 50%] Linking CXX executable Relocate
  54. CMakeFiles/Relocate.dir/main.cpp.o: In function `main':
  55. main.cpp:(.text+0x90): undefined reference to `sf::String::String(char const*, std::locale const&)'
  56. main.cpp:(.text+0xae): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
  57. main.cpp:(.text+0xe1): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings con
  58. st&)'
  59. main.cpp:(.text+0x11b): undefined reference to `sf::CircleShape::CircleShape(float, unsigned long)'
  60. main.cpp:(.text+0x129): undefined reference to `sf::Color::Green'
  61. main.cpp:(.text+0x131): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
  62. main.cpp:(.text+0x140): undefined reference to `sf::Window::isOpen() const'
  63. main.cpp:(.text+0x161): undefined reference to `sf::Window::pollEvent(sf::Event&)'
  64. main.cpp:(.text+0x17e): undefined reference to `sf::Window::close()'
  65. main.cpp:(.text+0x1a4): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
  66. main.cpp:(.text+0x1c1): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
  67. main.cpp:(.text+0x1da): undefined reference to `sf::RenderStates::Default'
  68. main.cpp:(.text+0x1e5): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
  69. main.cpp:(.text+0x1f4): undefined reference to `sf::Window::display()'
  70. main.cpp:(.text+0x21c): undefined reference to `sf::RenderWindow::~RenderWindow()'
  71. main.cpp:(.text+0x286): undefined reference to `sf::RenderWindow::~RenderWindow()'
  72. CMakeFiles/Relocate.dir/main.cpp.o: In function `sf::CircleShape::~CircleShape()':
  73. main.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0xf): undefined reference to `vtable for sf::CircleShape'
  74. main.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0x1d): undefined reference to `vtable for sf::CircleShape'
  75. main.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0x31): undefined reference to `sf::Shape::~Shape()'
  76. collect2: error: ld returned 1 exit status
  77. make[2]: *** [CMakeFiles/Relocate.dir/build.make:84: Relocate] Error 1
  78. make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/Relocate.dir/all] Error 2
  79. make: *** [Makefile:152: all] Error 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement