1 include(../cmake/QuickJSPIC.cmake)
2 set(CMAKE_SHARED_MODULE_SUFFIX .so)
5 set(CMAKE_SHARED_MODULE_PREFIX lib)
9 file_scaner(SOURCES RECURSE src EXT c h cc hh cpp hpp)
11 file_scaner(SOURCES RECURSE src EXT c h)
14 add_library(aqjs MODULE $<TARGET_OBJECTS:a> ${SOURCES})
15 set_target_properties(aqjs PROPERTIES DEFINE_SYMBOL A_EXPORTS OUTPUT_NAME a)
16 target_include_directories(aqjs PRIVATE ${QUICKJS_INCLUDE_DIR})
17 add_library_properties(aqjs PRIVATE alib)
18 set_library_options(aqjs)
21 target_link_libraries(aqjs PRIVATE ${QUICKJS_LIBRARIES})
24 if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test/CMakeLists.txt AND QJS_EXECUTABLE)
25 get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
27 if(NOT CMAKE_VERSION VERSION_LESS 3.0)
28 set(WORKING_DIRECTORY $<TARGET_FILE_DIR:aqjs>)
29 elseif(IS_MULTI_CONFIG)
30 set(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
32 set(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
35 add_subdirectory(test)