aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-10-12 22:22:17 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-10-12 22:22:17 +0200
commit6327df6f222c64376e57399ed11c803f14c92e9b (patch)
tree7bbb9dcf47a90d0888e055cbe2b04f5633f16abc /CMakeLists.txt
downloadcanvas_display.lv2-6327df6f222c64376e57399ed11c803f14c92e9b.tar.xz
initial commit.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..78f666d
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,59 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(canvas.lv2)
+
+include_directories(${PROJECT_SOURCE_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/pugl)
+
+set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,defs ${CMAKE_MODULE_LINKER_FLAGS}")
+add_definitions("-D_GNU_SOURCE=1") # asprintf
+
+file(STRINGS "VERSION" CANVAS_VERSION)
+string(REPLACE "." ";" VERSION_LIST ${CANVAS_VERSION})
+list(GET VERSION_LIST 0 CANVAS_MAJOR_VERSION)
+list(GET VERSION_LIST 1 CANVAS_MINOR_VERSION)
+list(GET VERSION_LIST 2 CANVAS_MICRO_VERSION)
+add_definitions("-DCANVAS_VERSION=\"${CANVAS_VERSION}\"")
+
+set(DEST lib/lv2/canvas.lv2)
+
+find_package(PkgConfig) # ${PKG_CONFIG_FOUND}
+
+pkg_search_module(LV2 REQUIRED lv2>=1.10)
+include_directories(${LV2_INCLUDE_DIRS})
+
+pkg_search_module(CAIRO REQUIRED cairo>=1.14)
+include_directories(${CAIRO_INCLUDE_DIRS})
+add_definitions("-DPUGL_HAVE_CAIRO")
+
+pkg_search_module(X11 REQUIRED x11>=1.6)
+include_directories(${X11_INCLUDE_DIRS})
+
+pkg_search_module(GL REQUIRED gl>=12.0)
+include_directories(${GL_INCLUDE_DIRS})
+add_definitions("-DPUGL_HAVE_GL")
+
+add_library(canvas MODULE
+ canvas.c)
+target_link_libraries(canvas
+ ${CAIRO_LDFLAGS})
+set_target_properties(canvas PROPERTIES PREFIX "")
+install(TARGETS canvas DESTINATION ${DEST})
+
+add_library(canvas_ui MODULE
+ canvas_ui.c
+ pugl/pugl/pugl_x11.c)
+target_link_libraries(canvas_ui
+ ${CAIRO_LDFLAGS}
+ ${X11_LDFLAGS}
+ ${GL_LDFLAGS})
+set_target_properties(canvas_ui PROPERTIES PREFIX "")
+install(TARGETS canvas_ui DESTINATION ${DEST})
+
+configure_file(${PROJECT_SOURCE_DIR}/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
+install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${DEST})
+install(FILES ${PROJECT_SOURCE_DIR}/canvas.ttl DESTINATION ${DEST})
+install(FILES ${PROJECT_SOURCE_DIR}/canvas_ui.ttl DESTINATION ${DEST})