2018-09-22 23:29:31 +02:00
|
|
|
project(gds-render)
|
|
|
|
|
2019-10-20 14:04:39 +02:00
|
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
|
|
set(CMAKE_INSTALL_PREFIX "/usr/" CACHE PATH "..." FORCE)
|
|
|
|
endif()
|
|
|
|
|
2019-10-18 19:29:04 +02:00
|
|
|
if(NOT WIN32)
|
|
|
|
string(ASCII 27 Esc)
|
|
|
|
set(ColorReset "${Esc}[m")
|
|
|
|
set(ColorBold "${Esc}[1m")
|
|
|
|
set(Red "${Esc}[31m")
|
|
|
|
set(Green "${Esc}[32m")
|
|
|
|
set(Yellow "${Esc}[33m")
|
|
|
|
set(Blue "${Esc}[34m")
|
|
|
|
set(Magenta "${Esc}[35m")
|
|
|
|
set(Cyan "${Esc}[36m")
|
|
|
|
set(White "${Esc}[37m")
|
|
|
|
set(BoldRed "${Esc}[1;31m")
|
|
|
|
set(BoldGreen "${Esc}[1;32m")
|
|
|
|
set(BoldYellow "${Esc}[1;33m")
|
|
|
|
set(BoldBlue "${Esc}[1;34m")
|
|
|
|
set(BoldMagenta "${Esc}[1;35m")
|
|
|
|
set(BoldCyan "${Esc}[1;36m")
|
|
|
|
set(BoldWhite "${Esc}[1;37m")
|
|
|
|
endif()
|
|
|
|
|
2018-05-07 13:27:50 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2018-05-18 18:47:19 +02:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(GLIB REQUIRED glib-2.0)
|
|
|
|
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
2018-07-11 12:24:15 +02:00
|
|
|
pkg_check_modules(CAIRO REQUIRED cairo)
|
2018-05-18 18:47:19 +02:00
|
|
|
|
2019-11-15 21:33:55 +01:00
|
|
|
include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2019-11-12 19:14:58 +01:00
|
|
|
add_subdirectory(plugins)
|
|
|
|
|
2019-11-12 18:14:07 +01:00
|
|
|
add_compile_options(-Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter)
|
2019-09-18 20:36:50 +02:00
|
|
|
|
2019-10-18 19:29:55 +02:00
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
message("${Yellow}Debug mode for translations used!${ColorReset}")
|
2019-10-20 14:04:39 +02:00
|
|
|
add_definitions(-DGETTEXT_PACKAGE=\"gds-render\" -DLOCALEDATADIR=\"${CMAKE_CURRENT_BINARY_DIR}/translations/output\")
|
|
|
|
message("${BoldMagenta}${CMAKE_CURRENT_BINARY_DIR}/translations/output used as data dir${ColorReset}")
|
2019-10-18 19:29:55 +02:00
|
|
|
else(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2019-11-16 14:54:58 +01:00
|
|
|
message("${BoldCyan}Global locale directory used. Make sure files in /usr/share/locale are available${ColorReset}")
|
2019-10-18 19:29:55 +02:00
|
|
|
add_definitions(-DGETTEXT_PACKAGE=\"gds-render\" -DLOCALEDATADIR=\"/usr/share\")
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
|
2019-05-20 19:04:22 +02:00
|
|
|
add_subdirectory(resources)
|
2018-12-10 23:45:53 +01:00
|
|
|
add_subdirectory(doxygen)
|
2019-10-18 22:51:31 +02:00
|
|
|
add_subdirectory(translations)
|
2019-03-11 10:36:02 +01:00
|
|
|
add_subdirectory(version)
|
2018-05-18 18:47:19 +02:00
|
|
|
|
2018-07-11 12:24:15 +02:00
|
|
|
link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
|
2018-05-18 18:47:19 +02:00
|
|
|
add_definitions(${GLIB2_CFLAGS_OTHER})
|
|
|
|
|
2018-07-19 15:11:18 +02:00
|
|
|
aux_source_directory("widgets" LAYER_SOURCES)
|
2019-06-17 21:32:45 +02:00
|
|
|
aux_source_directory("cell-selector" CELL_SELECTOR_SOURCES)
|
2019-03-21 21:24:59 +01:00
|
|
|
aux_source_directory("gds-utils" GDS_SOURCES)
|
2019-06-17 21:50:49 +02:00
|
|
|
aux_source_directory("output-renderers" OUTPUT_RENDERER_SOURCES)
|
2019-03-26 19:57:19 +01:00
|
|
|
aux_source_directory("geometric" GEOMETRIC_SOURCES)
|
2019-03-14 21:30:37 +01:00
|
|
|
aux_source_directory("layer" LAYER_SELECTOR_SOURCES)
|
2019-06-17 21:50:49 +02:00
|
|
|
set(SOURCE "main.c" "command-line.c" "gds-render-gui.c")
|
2018-05-17 21:46:14 +02:00
|
|
|
|
|
|
|
set(SOURCE
|
|
|
|
${SOURCE}
|
2018-05-22 16:17:14 +02:00
|
|
|
${LAYER_SOURCES}
|
2019-06-17 21:32:45 +02:00
|
|
|
${CELL_SELECTOR_SOURCES}
|
2019-03-21 21:24:59 +01:00
|
|
|
${GDS_SOURCES}
|
2019-06-17 21:50:49 +02:00
|
|
|
${OUTPUT_RENDERER_SOURCES}
|
2019-03-26 19:57:19 +01:00
|
|
|
${GEOMETRIC_SOURCES}
|
2019-03-13 20:32:09 +01:00
|
|
|
${LAYER_SELECTOR_SOURCES}
|
2018-05-17 21:46:14 +02:00
|
|
|
)
|
|
|
|
|
2019-11-14 19:31:57 +01:00
|
|
|
set(SOURCE_GENERATED
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/resources/resources.c
|
|
|
|
)
|
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${SOURCE_GENERATED} PROPERTIES GENERATED 1)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${SOURCE} ${SOURCE_GENERATED})
|
2018-05-18 18:47:19 +02:00
|
|
|
add_dependencies(${PROJECT_NAME} glib-resources)
|
2019-03-11 10:36:02 +01:00
|
|
|
add_dependencies(${PROJECT_NAME} version)
|
2019-10-20 14:04:39 +02:00
|
|
|
add_dependencies(${PROJECT_NAME} translations)
|
2019-11-14 19:31:57 +01:00
|
|
|
|
2019-03-11 10:36:02 +01:00
|
|
|
target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m version ${CMAKE_DL_LIBS})
|
2019-10-20 14:04:39 +02:00
|
|
|
install (TARGETS ${PROJECT_NAME}
|
|
|
|
RUNTIME
|
|
|
|
DESTINATION bin
|
|
|
|
)
|