CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(Castle) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include/irrlicht") FILE(GLOB SRCS src/*.cpp) ADD_EXECUTABLE(castle ${SRCS}) IF((${CMAKE_SYSTEM_NAME} MATCHES "Windows") AND (EXISTS "${CMAKE_SOURCE_DIR}/libs/libIrrlicht.dll")) TARGET_LINK_LIBRARIES(castle "${CMAKE_SOURCE_DIR}/libs/libIrrlicht.dll") ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/libs/libIrrlicht.so") TARGET_LINK_LIBRARIES(castle "${CMAKE_SOURCE_DIR}/libs/libIrrlicht.so") ENDIF()