2021-03-08 14:54:22 +00:00
|
|
|
set( KIPYTHON_SRCS
|
|
|
|
kipython_settings.cpp
|
|
|
|
python_scripting.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library( scripting STATIC
|
|
|
|
${KIPYTHON_SRCS}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries( scripting
|
|
|
|
${wxWidgets_LIBRARIES} # wxLogDebug, wxASSERT
|
|
|
|
${Boost_LIBRARIES} # Because of the OPT types
|
2021-04-27 00:32:09 +00:00
|
|
|
${PYTHON_LIBRARIES}
|
2021-03-08 14:54:22 +00:00
|
|
|
common
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories( scripting PUBLIC
|
|
|
|
${PYTHON_INCLUDE_DIRS}
|
|
|
|
${PROJECT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories( scripting PRIVATE
|
|
|
|
$<TARGET_PROPERTY:nlohmann_json,INTERFACE_INCLUDE_DIRECTORIES>
|
|
|
|
${PROJECT_SOURCE_DIR}/bitmaps_png/include
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
${wxWidgets_LIBRARIES}
|
|
|
|
${Boost_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Setup the KIFACE
|
|
|
|
add_library( scripting_kiface MODULE
|
|
|
|
kicad_scripting_main.cpp
|
2021-03-15 21:56:13 +00:00
|
|
|
kipython_frame.cpp
|
2021-03-08 14:54:22 +00:00
|
|
|
${KIPYTHON_SRCS}
|
|
|
|
)
|
|
|
|
|
|
|
|
set_source_files_properties( kicad_scripting_main.cpp PROPERTIES
|
|
|
|
# The KIFACE is in kicad_scripting_main.cpp, export it:
|
|
|
|
COMPILE_DEFINITIONS "BUILD_KIWAY_DLL;COMPILING_DLL"
|
|
|
|
)
|
2021-03-15 21:56:13 +00:00
|
|
|
|
2021-03-08 14:54:22 +00:00
|
|
|
target_include_directories( scripting_kiface PRIVATE
|
|
|
|
${PROJECT_SOURCE_DIR}/bitmaps_png/include
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
${wxWidgets_LIBRARIES}
|
|
|
|
${Boost_INCLUDE_DIR}
|
|
|
|
)
|
2021-04-27 00:32:09 +00:00
|
|
|
|
2022-03-15 00:32:29 +00:00
|
|
|
if( MSVC )
|
|
|
|
target_sources( scripting_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/kipython-dll.rc )
|
|
|
|
endif()
|
|
|
|
|
2021-03-08 14:54:22 +00:00
|
|
|
target_link_libraries( scripting_kiface
|
|
|
|
scripting
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties( scripting_kiface PROPERTIES
|
|
|
|
OUTPUT_NAME kipython
|
|
|
|
PREFIX ${KIFACE_PREFIX}
|
|
|
|
SUFFIX ${KIFACE_SUFFIX}
|
|
|
|
)
|
2021-04-27 00:32:09 +00:00
|
|
|
|
2021-03-08 14:54:22 +00:00
|
|
|
if( MAKE_LINK_MAPS )
|
|
|
|
set_target_properties( scripting_kiface PROPERTIES
|
|
|
|
LINK_FLAGS "-Wl,-cref,-Map=_scripting.kiface.map" )
|
|
|
|
endif()
|
|
|
|
|
2022-01-31 23:57:56 +00:00
|
|
|
if( APPLE )
|
2021-03-08 14:54:22 +00:00
|
|
|
set_target_properties( scripting_kiface PROPERTIES
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${OSX_BUNDLE_BUILD_KIFACE_DIR}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
install( TARGETS scripting_kiface
|
2022-06-22 21:33:46 +00:00
|
|
|
DESTINATION ${KICAD_KIFACE}
|
2021-03-08 14:54:22 +00:00
|
|
|
COMPONENT binary
|
|
|
|
)
|
|
|
|
endif()
|
2021-07-16 01:30:59 +00:00
|
|
|
|
|
|
|
if( KICAD_WIN32_INSTALL_PDBS )
|
|
|
|
# Get the PDBs to copy over for MSVC
|
2022-06-22 21:33:46 +00:00
|
|
|
install(FILES $<TARGET_PDB_FILE:scripting_kiface> DESTINATION ${KICAD_KIFACE})
|
2021-07-16 01:30:59 +00:00
|
|
|
endif()
|
|
|
|
|
2021-03-08 14:54:22 +00:00
|
|
|
# python shell installation
|
|
|
|
install( DIRECTORY ${PROJECT_SOURCE_DIR}/scripting/kicad_pyshell/
|
|
|
|
DESTINATION ${KICAD_DATA}/scripting/kicad_pyshell
|
|
|
|
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
|
2022-06-22 21:33:46 +00:00
|
|
|
)
|