Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ea4bec99
Commit
ea4bec99
authored
Dec 30, 2013
by
Marco Serantoni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MacOSX]/All purpose - Support for static linking
parent
7fa0aa8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
4 deletions
+50
-4
CMakeLists.txt
CMakeLists.txt
+40
-2
download_cairo.cmake
CMakeModules/download_cairo.cmake
+6
-1
CMakeLists.txt
cvpcb/CMakeLists.txt
+1
-0
CMakeLists.txt
pcbnew/CMakeLists.txt
+3
-1
No files found.
CMakeLists.txt
View file @
ea4bec99
...
...
@@ -40,6 +40,10 @@ option( KICAD_SCRIPTING_WXPYTHON
"set this option ON to build wxpython implementation for wx interface building in python and py.shell"
)
option
(
KICAD_BUILD_STATIC
"Builds Kicad and all libraries static (except wx-widgets)"
)
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
# PYTHON_EXECUTABLE can be defined when invoking cmake
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
...
...
@@ -156,7 +160,12 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if
(
GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-local-typedefs"
)
endif
()
if
(
APPLE
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-D__ASSERTMACROS__"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-D__ASSERTMACROS__"
)
endif
()
endif
(
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
if
(
KICAD_KEEPCASE
)
...
...
@@ -242,6 +251,19 @@ include( Functions )
include
(
ExternalProject
)
if
(
APPLE
)
set
(
KICAD_BUILD_STATIC ON
)
if
(
NOT CMAKE_CXX_COMPILER
)
EXEC_PROGRAM
(
wx-config ARGS --cc OUTPUT_VARIABLE CMAKE_C_COMPILER
)
endif
(
NOT CMAKE_CXX_COMPILER
)
if
(
NOT CMAKE_CXX_COMPILER
)
EXEC_PROGRAM
(
wx-config ARGS --cxx OUTPUT_VARIABLE CMAKE_CXX_COMPILER
)
endif
(
NOT CMAKE_CXX_COMPILER
)
endif
(
APPLE
)
#================================================
# Find libraries that are needed to build KiCad.
#================================================
...
...
@@ -256,6 +278,23 @@ add_definitions(-DWX_COMPATIBILITY)
find_package
(
OpenGL QUIET
)
check_find_package_result
(
OPENGL_FOUND
"OpenGL"
)
if
(
KICAD_BUILD_STATIC
)
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib;.dll")
include
(
download_pkgconfig
)
set
(
PKG_CONFIG_EXECUTABLE
"
${
PKGCONFIG_ROOT
}
/bin/pkg-config"
)
include
(
download_glew
)
set
(
GLEW_GLEW_LIBRARY
"
${
GLEW_ROOT
}
/lib/libGLEW.a"
)
set
(
GLEW_INCLUDE_DIR
"
${
GLEW_ROOT
}
/include"
)
include
(
download_pixman
)
set
(
PIXMAN_LIBRARY
"
${
PIXMAN_ROOT
}
/lib/libpixman-1.a"
)
include
(
download_libpng
)
include
(
download_cairo
)
set
(
CAIRO_INCLUDE_DIR
"
${
CAIRO_ROOT
}
/include/cairo"
)
set
(
CAIRO_LIBRARY
"
${
CAIRO_ROOT
}
/lib/libcairo.a"
)
endif
(
KICAD_BUILD_STATIC
)
#####################
# Find GLEW library #
#####################
...
...
@@ -272,7 +311,6 @@ check_find_package_result(CAIRO_FOUND "Cairo")
#################################################
include
(
download_boost
)
##########################
# Find wxWidgets library #
##########################
...
...
CMakeModules/download_cairo.cmake
View file @
ea4bec99
...
...
@@ -39,10 +39,15 @@ set( PREFIX ${DOWNLOAD_DIR}/cairo )
if
(
APPLE
)
if
(
CMAKE_OSX_ARCHITECTURES
)
set
(
CAIRO_CFLAGS
"CFLAGS=-arch
${
CMAKE_OSX_ARCHITECTURES
}
-
isysroot
${
CMAKE_OSX_SYSROOT
}
-
fno-lto"
)
set
(
CAIRO_CFLAGS
"CFLAGS=-arch
${
CMAKE_OSX_ARCHITECTURES
}
-fno-lto"
)
set
(
CAIRO_LDFLAGS
"LDFLAGS=-arch
${
CMAKE_OSX_ARCHITECTURES
}
-framework CoreGraphics -framework CoreServices"
)
set
(
CAIRO_OPTS
"--enable-quartz-image"
)
endif
(
CMAKE_OSX_ARCHITECTURES
)
if
(
CMAKE_OSX_SYSROOT
)
set
(
CAIRO_CFLAGS
"
${
CAIRO_CFLAGS
}
-isysroot
${
CMAKE_OSX_SYSROOT
}
"
)
endif
(
CMAKE_OSX_SYSROOT
)
endif
(
APPLE
)
# <SOURCE_DIR> = ${PREFIX}/src/glew
...
...
cvpcb/CMakeLists.txt
View file @
ea4bec99
...
...
@@ -107,6 +107,7 @@ target_link_libraries( cvpcb
${
GDI_PLUS_LIBRARIES
}
${
GLEW_LIBRARIES
}
${
CAIRO_LIBRARIES
}
${
PIXMAN_LIBRARY
}
)
# Only for win32 cross compilation using MXE
...
...
pcbnew/CMakeLists.txt
View file @
ea4bec99
...
...
@@ -367,7 +367,7 @@ if( KICAD_SCRIPTING_MODULES )
3d-viewer
pcbcommon
pnsrouter
common
c
${
ommon
pcad2kicadpcb
lib_dxf
${
GITHUB_PLUGIN_LIBRARIES
}
...
...
@@ -376,6 +376,7 @@ if( KICAD_SCRIPTING_MODULES )
gal
${
GLEW_LIBRARIES
}
${
CAIRO_LIBRARIES
}
${
PIXMAN_LIBRARY
}
${
wxWidgets_LIBRARIES
}
${
OPENGL_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
...
...
@@ -553,6 +554,7 @@ target_link_libraries( pcbnew
${
PCBNEW_EXTRA_LIBS
}
${
GLEW_LIBRARIES
}
${
CAIRO_LIBRARIES
}
${
PIXMAN_LIBRARY
}
${
Boost_LIBRARIES
}
# must follow GITHUB
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment