Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (51 sloc) 1.36 KB
#################################
# libkiss CMake Build File #
#################################
PROJECT(libkiss)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
SET(INCLUDE ${libkiss_SOURCE_DIR}/include)
SET(SRC ${libkiss_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${INCLUDE})
FILE(GLOB INCLUDES ${INCLUDE}/*.h)
SET(SOURCES
${SRC}/graphics_interface.c
${SRC}/kiss.c
${SRC}/kiss_graphics.c
${SRC}/kiss_graphics_draw.c
${SRC}/kiss_input.c
${SRC}/kiss_serial_buffer.c
${SRC}/kiss_util.c
${SRC}/serial_interface.c
${SRC}/thread_interface.c
${SRC}/timing_interface.c
)
IF(UNIX)
SET(SOURCES ${SOURCES}
${SRC}/kiss_serial_unix.c
)
ELSEIF(WIN32)
SET(SOURCES ${SOURCES}
${SRC}/kiss_serial_windows.c
)
ENDIF(UNIX)
SET(CMAKE_CXX_FLAGS "-Wall")
IF(APPLE)
ADD_DEFINITIONS(-arch i386 -arch x86_64 -g)
ELSEIF(WIN32)
SET(CMAKE_CXX_FLAGS "-Wl,--enable-auto-import")
ELSEIF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
SET(LIBRARY_OUTPUT_PATH ${libkiss_SOURCE_DIR}/lib)
ADD_LIBRARY(kiss STATIC ${SOURCES})
TARGET_LINK_LIBRARIES(kiss pthread glfw)
IF(APPLE)
FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
target_link_libraries(kiss ${OPENGL_LIBRARY} ${COCOA_LIBRARY})
ELSE(APPLE)
target_link_libraries(kiss opengl)
ENDIF(APPLE)
install(FILES ${INCLUDES} DESTINATION include)
INSTALL(TARGETS kiss ARCHIVE DESTINATION lib)
# add_subdirectory(test)