I'm getting some success with cmake but I'm having some problems
This is my folder
Code: Select all
Project
-CMakeLists.txt
-main.cpp
-Irrlicht
-include
-source
-bin/Linux
-bin
-CMakeLists.txt
-actual binary file
These are my CMakeLists files. First the one in the project folder
Code: Select all
cmake_minimum_required(VERSION 2.6)
project(PROJECTUNO)
#There are lots of scripts with cmake
#for finding external libraries.
#see /usr/local/share/cmake-2.6/Modules/Find*.cmake for more examples
find_package(OpenGL)
find_package(X11)
find_package(ZLIB)
set(CMAKE_CXX_FLAGS "-g -Wall")
add_subdirectory(bin)
And this in the bin folder
Code: Select all
include_directories(
${PROJECT_SOURCE_DIR}/Irrlicht/include
${PROJECT_SOURCE_DIR}/bin
${X11_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
)
link_directories(${PROJECT_BINARY_DIR}/Project)
add_executable(Project main.cpp
)
target_link_libraries(Project
${X11_LIBRARIES}
${GLUT_LIBRARIES}
${ZLIB_LIBRARIES}
${OPENGL_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/Irrlicht/lib/Linux/libIrrlicht.a
)
When I run cmake I get this warning
WARNING: Target "Project" requests linking to directory "/usr/include". Targets may link only to libraries. CMake is dropping the item.
and when I run make I get a bunch of errors like these
...
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:241: undefined reference to `glXGetProcAddressARB'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:468: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:472: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:477: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:484: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:488: undefined reference to `glGetIntegerv'
../../Irrlicht/lib/Linux/libIrrlicht.a(COpenGLExtensionHandler.o):/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:493: more undefined references to `glGetIntegerv' follow
../../Irrlicht/lib/Linux/libIrrlicht.a(COpenGLExtensionHandler.o): In function `irr::video::COpenGLExtensionHandler::initExtensions(bool)':
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:502: undefined reference to `glGetFloatv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:504: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:506: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:511: undefined reference to `glGetIntegerv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:521: undefined reference to `glGetFloatv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:522: undefined reference to `glGetFloatv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:523: undefined reference to `glGetFloatv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:524: undefined reference to `glGetFloatv'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:528: undefined reference to `glGetError'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:530: undefined reference to `glGetString'
/home/ragnarch/libraries/irrlicht-1.7.2/source/Irrlicht/COpenGLExtensionHandler.cpp:534: undefined reference to `glGetError'
...
This "libraries" folder doesn't even exist.
I used these tutorials
http://www.cs.swarthmore.edu/~adanner/tips/cmake.php
http://irrlicht.sourceforge.net/forum/v ... hp?t=37091