Commit 8f0a773b authored by Dick Hollenbeck's avatar Dick Hollenbeck

Add custom target on linux to make build-dir symlinks.

parent 8416c5d6
add_definitions(-DKICAD) add_definitions( -DKICAD )
include_directories(BEFORE ${INC_BEFORE}) include_directories( BEFORE ${INC_BEFORE} )
include_directories( include_directories(
${INC_AFTER} ${INC_AFTER}
) )
set(KICAD_SRCS set( KICAD_SRCS
class_treeprojectfiles.cpp class_treeprojectfiles.cpp
class_treeproject_item.cpp class_treeproject_item.cpp
commandframe.cpp commandframe.cpp
...@@ -19,48 +19,66 @@ set(KICAD_SRCS ...@@ -19,48 +19,66 @@ set(KICAD_SRCS
preferences.cpp preferences.cpp
prjconfig.cpp prjconfig.cpp
project_template.cpp project_template.cpp
tree_project_frame.cpp) tree_project_frame.cpp
)
if(MINGW) if( MINGW )
# KICAD_RESOURCES variable is set by the macro. # KICAD_RESOURCES variable is set by the macro.
mingw_resource_compiler(kicad) mingw_resource_compiler( kicad )
endif() endif()
if(APPLE) if( APPLE )
set(KICAD_RESOURCES kicad.icns kicad_doc.icns) set( KICAD_RESOURCES kicad.icns kicad_doc.icns )
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/kicad.icns" set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/kicad.icns" PROPERTIES
PROPERTIES MACOSX_PACKAGE_LOCATION Resources) MACOSX_PACKAGE_LOCATION Resources
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/kicad_doc.icns" )
PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties( "${CMAKE_CURRENT_SOURCE_DIR}/kicad_doc.icns" PROPERTIES
set(MACOSX_BUNDLE_ICON_FILE kicad.icns) MACOSX_PACKAGE_LOCATION Resources
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad) )
set(MACOSX_BUNDLE_NAME kicad) set( MACOSX_BUNDLE_ICON_FILE kicad.icns )
endif(APPLE) set( MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.kicad )
set( MACOSX_BUNDLE_NAME kicad )
endif()
add_executable(kicad WIN32 MACOSX_BUNDLE add_executable( kicad WIN32 MACOSX_BUNDLE
${KICAD_SRCS} ${KICAD_SRCS}
${KICAD_EXTRA_SRCS} ${KICAD_EXTRA_SRCS}
${KICAD_RESOURCES} ${KICAD_RESOURCES}
) )
if(APPLE) if( UNIX )
set_target_properties(kicad PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) # for build directory: create kiface symlinks so kicad (exe) can be run in-situ
target_link_libraries(kicad add_custom_target( kiface_sym_links
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/eeschema/_eeschema.kiface" "${CMAKE_BINARY_DIR}/kicad/_eeschema.kiface"
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.kiface" "${CMAKE_BINARY_DIR}/kicad/_pcbnew.kiface"
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/cvpcb/_cvpcb.kiface" "${CMAKE_BINARY_DIR}/kicad/_cvpcb.kiface"
COMMENT "Making <build-dir>/kicad/<kiface.symlinks>"
)
endif()
if( APPLE )
set_target_properties( kicad PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
target_link_libraries( kicad
common common
bitmaps bitmaps
polygon polygon
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
) )
else(APPLE) else()
target_link_libraries(kicad target_link_libraries( kicad
common common
bitmaps bitmaps
polygon polygon
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
${GDI_PLUS_LIBRARIES} ${GDI_PLUS_LIBRARIES}
) )
endif(APPLE) endif()
install(TARGETS kicad install( TARGETS kicad
DESTINATION ${KICAD_BIN} DESTINATION ${KICAD_BIN}
COMPONENT binary) COMPONENT binary
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment