aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt144
1 files changed, 0 insertions, 144 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 21be30d..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(canvas.lv2)
-
-include_directories(${PROJECT_SOURCE_DIR})
-include_directories(${PROJECT_SOURCE_DIR}/pugl)
-include_directories(${PROJECT_SOURCE_DIR}/ardour.lv2)
-
-set(CMAKE_FIND_FRAMEWORK FIRST)
-
-set(CMAKE_C_FLAGS "-fdata-sections -ffunction-sections ${CMAKE_C_FLAGS}")
-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 -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
-
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,defs ${CMAKE_MODULE_LINKER_FLAGS}")
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
-elseif(WIN32)
- set(CMAKE_C_FLAGS "-mstackrealign ${CMAKE_C_FLAGS}")
-endif()
-
-if(CMAKE_BUILD_TYPE STREQUAL "Release")
- if(APPLE)
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-dead_strip ${CMAKE_MODULE_LINKER_FLAGS}")
- else()
- set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--gc-sections -Wl,-s ${CMAKE_MODULE_LINKER_FLAGS}")
- endif()
-endif()
-
-add_definitions("-D_GNU_SOURCE=1") # asprintf
-
-if(WIN32)
- set(CANVAS_UI_TYPE "WindowsUI")
-elseif(APPLE)
- set(CANVAS_UI_TYPE "CocoaUI")
-else()
- set(CANVAS_UI_TYPE "X11UI")
-endif()
-
-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}\"")
-
-if(NOT DEFINED PLUGIN_DEST)
- set(PLUGIN_DEST lib/lv2/canvas.lv2)
-endif()
-
-find_package(PkgConfig) # ${PKG_CONFIG_FOUND}
-
-set(LIBS m)
-set(LIBS_UI m)
-set(TAR_UI test/canvas_ui.c)
-
-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})
-if(DEFINED STATIC_CAIRO)
- set(LIBS ${STATIC_CAIRO} ${STATIC_PIXMAN} ${LIBS})
- set(LIBS_UI ${STATIC_CAIRO} ${STATIC_PIXMAN} ${LIBS})
-
- if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
- set(LIBS ${LIBS} pthread)
- set(LIBS_UI ${LIBS_UI} pthread)
- endif()
-else()
- set(LIBS ${LIBS} ${CAIRO_LDFLAGS})
- set(LIBS_UI ${LIBS_UI} ${CAIRO_LDFLAGS})
-endif()
-add_definitions("-DPUGL_HAVE_CAIRO")
-
-find_package(OpenGL)
-if(${OPENGL_FOUND})
- set(LIBS_UI ${LIBS_UI} ${OPENGL_LIBRARIES})
- add_definitions("-DPUGL_HAVE_GL")
-else()
- message(STATUS "OpenGL not found")
-endif()
-
-if(WIN32)
- find_library(GDI32_LIBRARY NAMES gdi32)
- if(GDI32_LIBRARY)
- set(LIBS_UI ${LIBS_UI} ${GDI32_LIBRARY})
- else()
- message(FATAL_ERROR "gdi32 library not found")
- endif()
-
- find_library(USER32_LIBRARY NAMES user32)
- if(USER32_LIBRARY)
- set(LIBS_UI ${LIBS_UI} ${USER32_LIBRARY})
- else()
- message(FATAL_ERROR "user32 library not found")
- endif()
-
- set(TAR_UI ${TAR_UI} pugl/pugl/pugl_win.cpp)
-
-elseif(APPLE)
- find_library(COCOA_LIBRARY NAMES Cocoa)
- if(COCOA_LIBRARY)
- set(LIBS_UI ${LIBS_UI} ${COCOA_LIBRARY})
- else()
- message(FATAL_ERROR "Cocoa framework not found")
- endif()
-
- set(TAR_UI ${TAR_UI} pugl/pugl/pugl_osx.m)
-
-else() # GNU/Linux
- pkg_search_module(X11 REQUIRED x11>=1.6)
- include_directories(${X11_INCLUDE_DIRS})
- set(LIBS_UI ${LIBS_UI} ${X11_LDFLAGS})
-
- pkg_search_module(XEXT REQUIRED xext>=1.3)
- include_directories(${XEXT_INCLUDE_DIRS})
- set(LIBS_UI ${LIBS_UI} ${XEXT_LDFLAGS})
-
- set(TAR_UI ${TAR_UI} pugl/pugl/pugl_x11.c)
-endif()
-
-add_library(canvas MODULE test/canvas.c)
-target_link_libraries(canvas ${LIBS})
-set_target_properties(canvas PROPERTIES PREFIX "")
-set_target_properties(canvas PROPERTIES INTERPROCEDURAL_OPTIMIZATION true) # -flto
-if(NOT WIN32)
-set_target_properties(canvas PROPERTIES LINK_FLAGS "-Wl,-e,lv2_descriptor")
-endif()
-install(TARGETS canvas DESTINATION ${PLUGIN_DEST})
-
-add_library(canvas_ui MODULE ${TAR_UI})
-target_link_libraries(canvas_ui ${LIBS_UI})
-set_target_properties(canvas_ui PROPERTIES PREFIX "")
-set_target_properties(canvas_ui PROPERTIES INTERPROCEDURAL_OPTIMIZATION true) # -flto
-if(NOT WIN32)
-set_target_properties(canvas_ui PROPERTIES LINK_FLAGS "-Wl,-e,lv2ui_descriptor")
-endif()
-install(TARGETS canvas_ui DESTINATION ${PLUGIN_DEST})
-
-configure_file(${PROJECT_SOURCE_DIR}/test/manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
-install(FILES ${PROJECT_BINARY_DIR}/manifest.ttl DESTINATION ${PLUGIN_DEST})
-install(FILES ${PROJECT_SOURCE_DIR}/test/canvas.ttl DESTINATION ${PLUGIN_DEST})
-install(FILES ${PROJECT_SOURCE_DIR}/test/canvas_ui.ttl DESTINATION ${PLUGIN_DEST})