Skip to content

Commit

Permalink
update CMakeLists for subdir builds
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Oct 15, 2024
1 parent 26b11b0 commit 919d419
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,25 @@ target_compile_features(cfltk PRIVATE cxx_std_17)

if(USE_SYSTEM_FLTK)
target_include_directories(
cfltk PUBLIC $<BUILD_INTERFACE:include ${FLTK_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:include/cfltk>)
cfltk
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/cfltk>
${FLTK_INCLUDE_DIRS}
)
else()
target_include_directories(
cfltk
PUBLIC $<BUILD_INTERFACE:include fltk ${CMAKE_CURRENT_BINARY_DIR}/fltk>
$<INSTALL_INTERFACE:include/cfltk>)
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/cfltk>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fltk
${CMAKE_CURRENT_BINARY_DIR}/fltk
)
endif()


set(CFLTK_LIBS fltk)
set(pc_req_private)
set(pc_libs_private "-lfltk")
Expand Down
3 changes: 2 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ set(FLTK_BUILD_TEST OFF CACHE BOOL " " FORCE)
set(FLTK_OPTION_LARGE_FILE ON CACHE BOOL " " FORCE)
set(FLTK_BUILD_HTML_DOCS OFF CACHE BOOL " " FORCE)
set(FLTK_BUILD_PDF_DOCS OFF CACHE BOOL " " FORCE)
if (${CMAKE_SYSTE_NAME} STREQUAL MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(FLTK_USE_PANGO ON CACHE BOOL " " FORCE)
set(FLTK_GRAPHICS_CAIRO ON CACHE BOOL " " FORCE)
set(FLTK_BACKEND_WAYLAND OFF CACHE BOOL " " FORCE)
set(FLTK_BACKEND_X11 ON CACHE BOOL " " FORCE)
endif()

add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. cfltk)
Expand Down

0 comments on commit 919d419

Please sign in to comment.