Commit 852da7e8 authored by jan.koester's avatar jan.koester
Browse files

test

parent a6167cbd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -29,13 +29,16 @@ find_library(TinyXML2_LIBRARIES NAMES tinyxml2

# 3. Handle the standard arguments to report success/failure
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TinyXML2 DEFAULT_MSG
find_package_handle_standard_args(tinyxml2 DEFAULT_MSG
    TinyXML2_LIBRARIES
    TinyXML2_INCLUDE_DIR
)

# Compatibility alias for any existing checks using TinyXML2_FOUND.
set(TinyXML2_FOUND ${tinyxml2_FOUND})

# 4. Set the resulting variables for use by the project
if(TinyXML2_FOUND)
if(tinyxml2_FOUND)
    # The variable TINYXML2_LIBRARIES is already set from find_library
    set(TINYXML2_LIBRARIES ${TinyXML2_LIBRARIES})
    set(TINYXML2_INCLUDE_DIR ${TinyXML2_INCLUDE_DIR})
+8 −9
Original line number Diff line number Diff line
@@ -50,18 +50,17 @@ add_executable(blogi-editor
find_path(LIBNODE_INCLUDE_DIR NAMES node.h PATH_SUFFIXES node include/node)
find_library(LIBNODE_LIBRARY NAMES node libnode)

if(NOT LIBNODE_INCLUDE_DIR OR NOT LIBNODE_LIBRARY)
    message(FATAL_ERROR "libnode is required but was not found. Install libnode headers/library and reconfigure.")
endif()
# Export to widget subdirectories that include the shared node bridge header.
set(BLOGI_LIBNODE_INCLUDE_DIR "${LIBNODE_INCLUDE_DIR}" CACHE INTERNAL "blogi libnode include dir")
set(BLOGI_LIBNODE_LIBRARY "${LIBNODE_LIBRARY}" CACHE INTERNAL "blogi libnode library")

if(LIBNODE_INCLUDE_DIR AND LIBNODE_LIBRARY)
    message(STATUS "libnode enabled: ${LIBNODE_LIBRARY} (${LIBNODE_INCLUDE_DIR})")
    target_include_directories(blogi-editor PRIVATE ${LIBNODE_INCLUDE_DIR})
    target_link_libraries(blogi-editor ${LIBNODE_LIBRARY})
target_compile_definitions(blogi-editor PRIVATE BLOGI_HAVE_LIBNODE=1)

# Export to widget subdirectories that include the shared node bridge header.
set(BLOGI_LIBNODE_INCLUDE_DIR "${LIBNODE_INCLUDE_DIR}" CACHE INTERNAL "blogi libnode include dir")
set(BLOGI_LIBNODE_LIBRARY "${LIBNODE_LIBRARY}" CACHE INTERNAL "blogi libnode library")
else()
    message(STATUS "libnode not found; building editor with external Node.js runner only")
endif()

if(TARGET blogidev)
    target_link_libraries(blogi-editor
+0 −6
Original line number Diff line number Diff line
@@ -4,12 +4,6 @@
#include <string>
#include <vector>

#ifndef BLOGI_HAVE_LIBNODE
#error "BLOGI_HAVE_LIBNODE must be defined: this build supports only embedded libnode"
#endif

#include <node.h>

namespace blogi::webedit::nodebridge {

inline std::string getEnvOrDefault(const char *key, const char *fallback) {
+4 −2
Original line number Diff line number Diff line
add_library(nodewidget SHARED nodewidget.cpp)

if(BLOGI_LIBNODE_INCLUDE_DIR)
    target_include_directories(nodewidget PRIVATE ${BLOGI_LIBNODE_INCLUDE_DIR})
target_compile_definitions(nodewidget PRIVATE BLOGI_HAVE_LIBNODE=1)
endif()

if(TARGET blogidev)
    add_dependencies(nodewidget blogidev)