Skip to content
Snippets Groups Projects
Commit ff0248f5 authored by soblin's avatar soblin
Browse files

(1) disable flags OFF (2) set matplotlibcpp17::matplotlibcpp17 target for add_subdirectory()


Signed-off-by: default avatarsoblin <hilo.sobli@gmail.com>
parent 235674f4
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,12 @@ endif()
# gallery
if(NOT DEFINED USE_GUI)
set(USE_GUI 1)
message(STATUS "set USE_GUI = ON")
set(USE_GUI 0)
message(STATUS "set USE_GUI = OFF")
endif()
if(NOT DEFINED ADD_DEMO)
set(ADD_DEMO 1)
message(STATUS "set ADD_DEMO = ON")
set(ADD_DEMO 0)
message(STATUS "set ADD_DEMO = OFF")
endif()
if(USE_GUI)
message(STATUS "USE_GUI = ON")
......@@ -52,8 +52,6 @@ else()
message(STATUS "ADD_DEMO = OFF")
endif()
set(matplotlibcpp17_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include")
function(add_demo name path)
add_executable(${name} ${path})
target_include_directories(${name} PUBLIC ${Python3_INCLUDE_DIRS}
......@@ -82,6 +80,11 @@ if(${ADD_DEMO})
add_subdirectory(gallery/scales)
endif()
# for add_subdirectory
add_library(matplotlibcpp17::matplotlibcpp17 INTERFACE IMPORTED GLOBAL)
set_property(TARGET matplotlibcpp17::matplotlibcpp17 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include ${Python3_INCLUDE_DIRS})
set_property(TARGET matplotlibcpp17::matplotlibcpp17 PROPERTY INTERFACE_LINK_LIBRARIES ${Python3_LIBRARIES} pybind11::embed)
# install https://dominikberner.ch/cmake-interface-lib/
include(GNUInstallDirs)
add_library(${PROJECT_NAME} INTERFACE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment