Hello all. I have read through a bunch of threads on this forum that talked about similar problems and I made a lot of progress, but there is something weird which is happening that none of those threads quite addressed. So forgive me if this has been asked a million times.
I'm currently getting the following error when trying to configure:
CMake Error at cmake/Modules/FindSFML.cmake:199 (message):
SFML found but version too low (requested: 2.0, found: 1.x)
Call Stack (most recent call first):
CMakeLists.txt:25 (find_package)
I am quite definitely using SFML 2.0. I even redownloaded the release candidate to make sure.
To help give some context, right before receiving this error, I had gotten an error saying CMake could not find SFML (I dunno what's up with the FindSFML.make or what I did to get that message). I fixed it by added an SFMLDIR path to C:/Program Files(x86)/SFML 2.0 where I have it installed. That let me continue on until I encountered the error above. Any ideas?
I tried changing it to just SFML (which will accept any version, right?) and then it gave me the error of not being able to find the SFML libraries again.
You tried to change what?
Here's an example CMake script for building a library that links against the Graphics, Window and System module and gives an option to build a shared or a static library.
Deleted my 1.6 folder. Nothing seemed to change :/
Well you need to give some more information on your setup and what you're doing, otherwise it's impossible for us to make some guesses...
Sorry, when I said I changed SFML 2.0 to SFML I meant in the Cmake file. Here is our cmake file:
project(JollyLava CXX)
cmake_minimum_required( VERSION 2.6 )
# Set version information in a config.h file
set(myproject_VERSION_MAJOR 0)
set(myproject_VERSION_MINOR 1)
# Name of this library.
set(LIBRARY_NAME "JollyLava")
#
# --- User options
#
set(JOLLYLAVA_BUILD_EXAMPLES FALSE CACHE BOOL
"Build sandbox targets that try out the various classes.")
set(JOLLYLAVA_BUILD_DOC FALSE CACHE BOOL
"Create API documentation (requires Doxygen).")
#
# --- Dependencies
#
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
# SFML
find_package(SFML 2.0 REQUIRED system window graphics network audio)
# Box2D
find_package(Box2D REQUIRED)
include_directories("${BOX2D_INCLUDE_DIR}")
# Include headers.
include_directories(${CMAKE_SOURCE_DIR}/include)
# C++ source code.
add_subdirectory(src)
# Example executables.
if(JOLLYLAVA_BUILD_EXAMPLES)
add_subdirectory(examples)
endif(JOLLYLAVA_BUILD_EXAMPLES)
# Doxygen API documentation
if(JOLLYLAVA_BUILD_DOC)
find_package(Doxygen REQUIRED)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM)
endif(DOXYGEN_FOUND)
endif(JOLLYLAVA_BUILD_DOC)
# http://www.dlyr.fr/stuff/2012/03/release-and-debug-with-cmake-and-qtcreator/
#if(CMAKE_BUILD_TYPE STREQUAL "debug")
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib-debug)
# set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib-debug)
# set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin-dbg)
#else()
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
# set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib)
# set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
#endif()
# Install target
#install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
# CPack packaging
#include(InstallRequiredSystemLibraries)
#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
#set(CPACK_PACKAGE_VERSION_MAJOR "${myproject_VERSION_MAJOR}")
#set(CPACK_PACKAGE_VERSION_MINOR "${myproject_VERSION_MINOR}")
#include(CPack)
#${UIS} ${RSCS} ${TRS} ${MOCS} )