Reputation: 641
I'm getting this completely un-google-able error while trying to compile a project in cygwin using cmake on Windows.
The CMakeLists.txt file in question is:
# Minimum cmake version (required)
cmake_minimum_required( VERSION 2.8.4 )
# Project name
project( sdlinterface )
# Find SDL2
include( FindPkgConfig )
pkg_search_module( SDL2 REQUIRED sdl2 )
set (PROJECT_INCLUDE_DIR
${SDL2_INCLUDE_DIRS} # SDL headers
${PROJECT_SOURCE_DIR}/include
)
set (PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(PROJECT_SRCS
${PROJECT_SOURCE_DIR}/SDLMain.cpp
${PROJECT_SOURCE_DIR}/SDLWindow.cpp
${PROJECT_SOURCE_DIR}/SDLEventLoop.cpp
)
# Set the compiler flags (specifically the c++11 one)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories("${PROJECT_BINARY_DIR}")
include_directories("${PROJECT_INCLUDE_DIR}")
add_library(${PROJECT_NAME} SHARED ${PROJECT_SRCS})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
# Link project with SDL
target_link_libraries(${PROJECT_NAME}
SDL2
)
Any ideas why when I call make it's trying to compile a cygwin target?
The full error message is
$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxxx/Projects/sdlgame/Source/build
make[2]: *** No rule to make target 'cygwin', needed by 'cygsdlinterface.dll'. Stop.
CMakeFiles/Makefile2:170: recipe for target 'Libraries/LEngine/sdlinterface/build/CMakeFiles/sdlinterface.dir/all' failed
make[1]: *** [Libraries/LEngine/sdlinterface/build/CMakeFiles/sdlinterface.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2
Upvotes: 1
Views: 2212
Reputation: 10195
Maybe not a solution, but at least some ideas
include( FindPkgConfig )
you can use find_package(PkgConfig)
${SDL2_LIBRARIES}
and ${SDL2_LDFLAGS}
instead of target_link_libraries(... SDL2)
Upvotes: 3