Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install FindJavaScriptCore.cmake to simplify consumption #31

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if(NOT INCLUDEJS_COMPONENTS)
list(APPEND INCLUDEJS_COMPONENTS engine)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")

foreach(component ${INCLUDEJS_COMPONENTS})
if(component STREQUAL "engine")
include(CMakeFindDependencyMacro)
Expand Down
8 changes: 8 additions & 0 deletions src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ noa_library(PROJECT includejs NAME engine
FOLDER "IncludeJS/Engine"
PRIVATE_HEADERS context.h function.h error.h promise.h value.h
SOURCES ${INCLUDEJS_ENGINE_SOURCES})

if(INCLUDEJS_INSTALL)
noa_library_install(PROJECT includejs NAME engine)
if(INCLUDEJS_BACKEND STREQUAL "JavaScriptCore")
install(FILES
"${PROJECT_SOURCE_DIR}/cmake/FindJavaScriptCore.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/includejs"
COMPONENT includejs_dev)
endif()
endif()

sourcemeta_includejs_add_compile_options(includejs_engine)

if(INCLUDEJS_BACKEND STREQUAL "JavaScriptCore")
Expand Down
1 change: 0 additions & 1 deletion test/packaging/find_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ project(includejs_hello VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../../cmake")
find_package(IncludeJS REQUIRED)
add_executable(includejs_hello hello.cc)
target_link_libraries(includejs_hello PRIVATE includejs::engine)