Cmake suddenly can't find my source files anymore...

Posted by aheld on Stack Overflow See other posts from Stack Overflow or by aheld
Published on 2010-03-12T08:09:20Z Indexed on 2010/03/12 8:17 UTC
Read the original article Hit count: 310

Filed under:

To make a long story short:

alt text

To add insult to injury, CMake actually ran fine several times. I was wrestling with a compiler error when CMake suddenly didn't feel like working anymore. For reference, here's the whole CMakeLists.txt file:

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Find_Package ( SDL REQUIRED )
Find_Package ( SDL_image REQUIRED )
Find_Package ( SDL_mixer REQUIRED )

if ( NOT SDL_FOUND )
   message ( FATAL_ERROR "Make sure that SDL is installed" )
endif ( NOT SDL_FOUND )

link_libraries (
   ${SDL_LIBRARY}
   ${SDLIMAGE_LIBRARY}
   ${SDLMIXER_LIBRARY}
   SDLmain
)

set(wiggle_SOURCES 
        level.cpp
        levelgenerator.cpp
        main.cpp
        player.cpp
        scoreboard.cpp
        snake.cpp
        soundplayer.cpp
        titlescreen.cpp
    )

add_executable(Wiggle ../${wiggle_SOURCES})

The error occured for the first time when, instead of simply typing "make", I typed "make -lSDL -lSDL_image -lSDL_mixer" - make refused to find the header files SDL.h and SDL_image.h after I detached the project from Code::Blocks.

© Stack Overflow or respective owner

Related posts about cmake