Skip to content

Commit d14691b

Browse files
committed
Add Linux Cairo support to sample CMakeFiles
1 parent 3827783 commit d14691b

File tree

9 files changed

+354
-32
lines changed

9 files changed

+354
-32
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# CMakeLists.txt for BSpline sample with Cairo support on Linux
2+
3+
cmake_minimum_required( VERSION 3.10 FATAL_ERROR )
4+
set( CMAKE_VERBOSE_MAKEFILE ON )
5+
6+
project( BSpline )
7+
8+
get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." ABSOLUTE )
9+
get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
10+
11+
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
12+
13+
# Linux-specific Cairo handling
14+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
15+
# Add our custom FindCairo module to the module path
16+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
17+
18+
# Find system Cairo
19+
find_package( Cairo REQUIRED )
20+
21+
# Include Cairo headers and Cinder Cairo wrapper
22+
set( CAIRO_SOURCES
23+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
24+
)
25+
26+
set( CAIRO_INCLUDES
27+
${CINDER_PATH}/blocks/Cairo/include
28+
${CAIRO_INCLUDE_DIRS}
29+
)
30+
31+
ci_make_app(
32+
SOURCES ${APP_PATH}/src/BSplineApp.cpp ${CAIRO_SOURCES}
33+
INCLUDES ${CAIRO_INCLUDES}
34+
LIBRARIES ${CAIRO_LIBRARIES}
35+
CINDER_PATH ${CINDER_PATH}
36+
)
37+
38+
# Link Cairo libraries and set include directories
39+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
40+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
41+
42+
else()
43+
# Use standard CinderBlock for other platforms
44+
ci_make_app(
45+
SOURCES ${APP_PATH}/src/BSplineApp.cpp
46+
BLOCKS Cairo
47+
CINDER_PATH ${CINDER_PATH}
48+
)
49+
endif()
Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# CMakeLists.txt for CairoBasic sample on Linux
2+
# This demonstrates how to build Cairo samples using system Cairo libraries
3+
14
cmake_minimum_required( VERSION 3.10 FATAL_ERROR )
25
set( CMAKE_VERBOSE_MAKEFILE ON )
36

@@ -8,7 +11,41 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
811

912
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1013

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/CairoBasicApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
14+
# Linux-specific Cairo handling
15+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
16+
# Add our custom FindCairo module to the module path
17+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
18+
19+
# Find system Cairo
20+
find_package( Cairo REQUIRED )
21+
22+
# Include Cinder Cairo wrapper source
23+
set( CAIRO_SOURCES
24+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
25+
)
26+
27+
set( CAIRO_INCLUDES
28+
${CINDER_PATH}/blocks/Cairo/include
29+
${CAIRO_INCLUDE_DIRS}
30+
)
31+
32+
ci_make_app(
33+
SOURCES ${APP_PATH}/src/CairoBasicApp.cpp ${CAIRO_SOURCES}
34+
INCLUDES ${CAIRO_INCLUDES}
35+
LIBRARIES ${CAIRO_LIBRARIES}
36+
CINDER_PATH ${CINDER_PATH}
37+
)
38+
39+
# Link Cairo libraries and set include directories
40+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
41+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
42+
43+
44+
else()
45+
# Use standard CinderBlock for other platforms
46+
ci_make_app(
47+
SOURCES ${APP_PATH}/src/CairoBasicApp.cpp
48+
BLOCKS Cairo
49+
CINDER_PATH ${CINDER_PATH}
50+
)
51+
endif()

samples/FontSample/proj/cmake/CMakeLists.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,40 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/FontSampleApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/FontSampleApp.cpp ${CAIRO_SOURCES}
31+
INCLUDES ${CAIRO_INCLUDES}
32+
LIBRARIES ${CAIRO_LIBRARIES}
33+
CINDER_PATH ${CINDER_PATH}
34+
)
35+
36+
# Link Cairo libraries and set include directories
37+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
38+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
39+
40+
else()
41+
# Use standard CinderBlock for other platforms
42+
ci_make_app(
43+
SOURCES ${APP_PATH}/src/FontSampleApp.cpp
44+
BLOCKS Cairo
45+
CINDER_PATH ${CINDER_PATH}
46+
)
47+
endif()

samples/Wisteria/proj/cmake/CMakeLists.txt

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,45 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/WisteriaApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/WisteriaApp.cpp
31+
${APP_PATH}/src/Branch.cpp
32+
${CAIRO_SOURCES}
33+
INCLUDES ${APP_PATH}/include
34+
${CAIRO_INCLUDES}
35+
LIBRARIES ${CAIRO_LIBRARIES}
36+
CINDER_PATH ${CINDER_PATH}
37+
)
38+
39+
# Link Cairo libraries and set include directories
40+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
41+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
42+
43+
else()
44+
# Use standard CinderBlock for other platforms
45+
ci_make_app(
46+
SOURCES ${APP_PATH}/src/WisteriaApp.cpp
47+
${APP_PATH}/src/Branch.cpp
48+
INCLUDES ${APP_PATH}/include
49+
BLOCKS Cairo
50+
CINDER_PATH ${CINDER_PATH}
51+
)
52+
endif()

samples/_svg/AnimatedReveal/proj/cmake/CMakeLists.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,40 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/AnimatedRevealApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/AnimatedRevealApp.cpp ${CAIRO_SOURCES}
31+
INCLUDES ${CAIRO_INCLUDES}
32+
LIBRARIES ${CAIRO_LIBRARIES}
33+
CINDER_PATH ${CINDER_PATH}
34+
)
35+
36+
# Link Cairo libraries and set include directories
37+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
38+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
39+
40+
else()
41+
# Use standard CinderBlock for other platforms
42+
ci_make_app(
43+
SOURCES ${APP_PATH}/src/AnimatedRevealApp.cpp
44+
BLOCKS Cairo
45+
CINDER_PATH ${CINDER_PATH}
46+
)
47+
endif()

samples/_svg/EuroMap/proj/cmake/CMakeLists.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,40 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/EuroMapApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/EuroMapApp.cpp ${CAIRO_SOURCES}
31+
INCLUDES ${CAIRO_INCLUDES}
32+
LIBRARIES ${CAIRO_LIBRARIES}
33+
CINDER_PATH ${CINDER_PATH}
34+
)
35+
36+
# Link Cairo libraries and set include directories
37+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
38+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
39+
40+
else()
41+
# Use standard CinderBlock for other platforms
42+
ci_make_app(
43+
SOURCES ${APP_PATH}/src/EuroMapApp.cpp
44+
BLOCKS Cairo
45+
CINDER_PATH ${CINDER_PATH}
46+
)
47+
endif()

samples/_svg/GoodNightMorning/proj/cmake/CMakeLists.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,40 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/GoodNightMorningApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/GoodNightMorningApp.cpp ${APP_PATH}/src/TweetStream.cpp ${CAIRO_SOURCES}
31+
INCLUDES ${CAIRO_INCLUDES}
32+
LIBRARIES ${CAIRO_LIBRARIES}
33+
CINDER_PATH ${CINDER_PATH}
34+
)
35+
36+
# Link Cairo libraries and set include directories
37+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
38+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
39+
40+
else()
41+
# Use standard CinderBlock for other platforms
42+
ci_make_app(
43+
SOURCES ${APP_PATH}/src/GoodNightMorningApp.cpp ${APP_PATH}/src/TweetStream.cpp
44+
BLOCKS Cairo
45+
CINDER_PATH ${CINDER_PATH}
46+
)
47+
endif()

samples/_svg/SimpleViewer/proj/cmake/CMakeLists.txt

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,40 @@ get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )
88

99
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )
1010

11-
ci_make_app(
12-
SOURCES ${APP_PATH}/src/SimpleViewerApp.cpp
13-
CINDER_PATH ${CINDER_PATH}
14-
)
11+
# Linux-specific Cairo handling
12+
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
13+
# Add our custom FindCairo module to the module path
14+
list(APPEND CMAKE_MODULE_PATH "${CINDER_PATH}/proj/cmake/modules")
15+
16+
# Find system Cairo
17+
find_package( Cairo REQUIRED )
18+
19+
# Include Cairo headers and Cinder Cairo wrapper
20+
set( CAIRO_SOURCES
21+
${CINDER_PATH}/blocks/Cairo/src/Cairo.cpp
22+
)
23+
24+
set( CAIRO_INCLUDES
25+
${CINDER_PATH}/blocks/Cairo/include
26+
${CAIRO_INCLUDE_DIRS}
27+
)
28+
29+
ci_make_app(
30+
SOURCES ${APP_PATH}/src/SimpleViewerApp.cpp ${CAIRO_SOURCES}
31+
INCLUDES ${CAIRO_INCLUDES}
32+
LIBRARIES ${CAIRO_LIBRARIES}
33+
CINDER_PATH ${CINDER_PATH}
34+
)
35+
36+
# Link Cairo libraries and set include directories
37+
target_link_libraries( ${PROJECT_NAME} PRIVATE ${CAIRO_LIBRARIES} )
38+
target_include_directories( ${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS} )
39+
40+
else()
41+
# Use standard CinderBlock for other platforms
42+
ci_make_app(
43+
SOURCES ${APP_PATH}/src/SimpleViewerApp.cpp
44+
BLOCKS Cairo
45+
CINDER_PATH ${CINDER_PATH}
46+
)
47+
endif()

0 commit comments

Comments
 (0)