Skip to content

Commit 30b92ff

Browse files
committed
Add a flag througout all the build system to manage manylinux (PyPI).
* New: In boostrap/FindBootstrap.cmake, add a macro setup_qt() to share Python detection across the various tools. This macro takes into account the USE_MANYLINUX variable to slightly change the Python detection. On a "normal" system we look for "Development" (search for dynamic libraries) while under manylinux we look for "Development.Module"(static linking). * Change: In bootstrap/ccb.py, add a new option --manylinux. * Change: Cleanup in the various CMakeLists.txt to use setup_qt().
1 parent ecdcabb commit 30b92ff

29 files changed

+37
-28
lines changed

Seabreeze/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
set_cmake_policies()
1919
setup_boost(program_options)
2020
setup_qt()
21+
setup_python()
2122

2223
find_package(Libexecinfo REQUIRED)
23-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2424
find_package(PythonSitePackages REQUIRED)
2525
find_package(LEFDEF REQUIRED)
2626
find_package(FLUTE REQUIRED)

anabatic/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
set_cmake_policies()
1919
setup_boost()
2020
setup_qt()
21+
setup_python()
2122

22-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2323
find_package(PythonSitePackages REQUIRED)
2424
find_package(FLUTE REQUIRED)
2525
find_package(HURRICANE REQUIRED)

anabatic/src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ endif ( CHECK_DETERMINISM )
1414
${QtX_INCLUDE_DIRS}
1515
${Python_INCLUDE_DIRS}
1616
)
17-
find_package (Python3 COMPONENTS Interpreter Development)
1817
set( includes anabatic/Constants.h
1918
anabatic/Configuration.h
2019
anabatic/Matrix.h

bootstrap/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
list(INSERT CMAKE_MODULE_PATH 0 "${Bootstrap_SOURCE_DIR}/cmake_modules/")
1313
find_package(Bootstrap REQUIRED)
14-
# find_package(Python 3 REQUIRED COMPONENTS Interpreter Development )
15-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development )
14+
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development.Module )
1615
find_package(PythonSitePackages REQUIRED)
1716
print_cmake_module_path()
1817

bootstrap/builder/Builder.py

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def __init__ ( self ):
3535
self._noCache = False
3636
self._ninja = False
3737
self._clang = False
38+
self._manylinux = False
3839
self._noSystemBoost = False
3940
self._macports = False
4041
self._devtoolset = 0
@@ -62,6 +63,7 @@ def __setattr__ ( self, attribute, value ):
6263
elif attribute == "noCache": self._noCache = value
6364
elif attribute == "ninja": self._ninja = value
6465
elif attribute == "clang": self._clang = value
66+
elif attribute == "manylinux": self._manylinux = value
6567
elif attribute == "macports":
6668
self._macports = value
6769
if value: self._noSystemBoost = True
@@ -177,6 +179,7 @@ def _build ( self, tool ):
177179
if self._bfd: command += [ "-D", "USE_LIBBFD:STRING=%s" % self._bfd ]
178180
if self._qt4: command += [ "-D", "WITH_QT4:STRING=TRUE" ]
179181
if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ]
182+
if self._manylinux: command += [ "-D", "USE_MANYLINUX:STRING=TRUE" ]
180183
command += [ "-D", "CMAKE_BUILD_TYPE:STRING=%s" % self.buildMode
181184
#, "-D", "BUILD_SHARED_LIBS:STRING=%s" % self.enableShared
182185
, "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir

bootstrap/ccb.py

+2
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def autoLocate ():
211211
parser.add_option ( "--openmp" , action="store_true" , dest="openmp" , help="Enable the use of OpenMP in Gcc." )
212212
parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." )
213213
parser.add_option ( "--clang" , action="store_true" , dest="clang" , help="Force use of Clang C/C++ compiler instead of system default." )
214+
parser.add_option ( "--manylinux" , action="store_true" , dest="manylinux" , help="Build target is manylinux (PyPY)." )
214215
parser.add_option ( "--make" , action="store" , type="string", dest="makeArguments" , help="Arguments to pass to make (ex: \"-j4 install\")." )
215216
parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." )
216217
parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." )
@@ -282,6 +283,7 @@ def autoLocate ():
282283
if options.llvmtoolset: builder.llvmtoolset = options.llvmtoolset
283284
if options.bfd: builder.bfd = "ON"
284285
if options.qt4: builder.qt4 = True
286+
if options.manylinux: builder.manylinux = True
285287
if options.openmp: builder.openmp = True
286288
if options.makeArguments: builder.makeArguments = options.makeArguments
287289
#if options.svnMethod: builder.svnMethod = options.svnMethod

bootstrap/cmake_modules/FindBootstrap.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,20 @@ endif()
223223
endmacro(setup_boost)
224224

225225

226+
#
227+
# Setup Python, select detection depending on USE_MANYLINUX.
228+
#
229+
macro(setup_python)
230+
set(pydevelArg "Development")
231+
232+
if (USE_MANYLINUX)
233+
message(STATUS "Build for manylinux")
234+
set(pydevelArg "Development.Module")
235+
endif()
236+
find_package(Python 3 REQUIRED COMPONENTS Interpreter ${pydevelArg} )
237+
endmacro()
238+
239+
226240
#
227241
# Find Qt, the union of all the modules we need for the whole project.
228242
#

bora/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
setup_boost(program_options)
1919
setup_qt()
2020
setup_qwt()
21+
setup_python()
2122

2223
find_package(Libexecinfo REQUIRED)
23-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2424
find_package(PythonSitePackages REQUIRED)
2525
find_package(LEFDEF REQUIRED)
2626
find_package(FLUTE REQUIRED)

crlcore/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
2222
setup_boost(program_options)
2323
setup_qt()
24+
setup_python()
2425

2526
cmake_policy(SET CMP0054 NEW)
2627

2728
if (USE_LIBBFD)
2829
find_package(Libbfd)
2930
endif()
3031
find_package(BZip2 REQUIRED)
31-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
3232
find_package(PythonSitePackages REQUIRED)
3333
find_package(BISON REQUIRED)
3434
find_package(FLEX REQUIRED)

crlcore/src/cyclop/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- explicit-buffer-name: "CMakeLists.txt<crlcore/src/ccore/cyclop>" -*-
22

3-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
43
include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore
54
${HURRICANE_INCLUDE_DIR}
65
${UTILITIES_INCLUDE_DIR}

crlcore/src/pyCRL/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
-lutil
3333
)
3434

35-
find_package (Python3 COMPONENTS Interpreter Development)
36-
3735
add_definitions( -DCORIOLIS_TOP="${CORIOLIS_TOP}"
3836
-DSYS_CONF_DIR="${SYS_CONF_DIR}"
3937
-DPYTHON_SITE_PACKAGES="${PYTHON_SITE_PACKAGES}"

crlcore/src/x2y/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- explicit-buffer-name: "CMakeLists.txt<crlcore/src/x2y> -*-
22

33

4-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
54
include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore
65
${HURRICANE_INCLUDE_DIR}
76
${UTILITIES_INCLUDE_DIR}

etesian/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
set_cmake_policies()
1919
setup_boost(program_options)
20+
setup_python()
2021

21-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2222
find_package(PythonSitePackages REQUIRED)
2323
find_package(HURRICANE REQUIRED)
2424
#find_package(KATABATIC REQUIRED)

etesian/src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
${Boost_INCLUDE_DIRS}
1111
${Python_INCLUDE_DIRS}
1212
)
13-
find_package (Python3 COMPONENTS Interpreter Development)
1413
set( includes etesian/Configuration.h
1514
etesian/Placement.h
1615
etesian/FeedCells.h

flute/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
set_cmake_policies()
1717
check_distribution()
1818
setup_sysconfdir( "${CMAKE_INSTALL_PREFIX}" )
19+
setup_python()
1920

20-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2121
find_package(PythonSitePackages REQUIRED)
2222
find_package(HURRICANE REQUIRED)
2323
find_package(CORIOLIS REQUIRED)

flute/src/3.1/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
${CONFIGURATION_INCLUDE_DIR}
77
${Python_INCLUDE_DIRS}
88
)
9-
find_package (Python3 COMPONENTS Interpreter Development)
109

1110
set( includes flute.h
1211
dl.h

foehn/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
set_cmake_policies()
1919
setup_boost(program_options)
2020
setup_qt()
21+
setup_python()
2122

2223
find_package(Libexecinfo REQUIRED)
23-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2424
find_package(PythonSitePackages REQUIRED)
2525
find_package(LEFDEF REQUIRED)
2626
find_package(FLUTE REQUIRED)

hurricane/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
cmake_policy(SET CMP0054 NEW)
2121
setup_boost(program_options)
2222
setup_qt()
23+
setup_python()
2324

2425
find_package(BZip2 REQUIRED)
2526
find_package(BISON REQUIRED)
2627
find_package(FLEX REQUIRED)
27-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development )
2828
find_package(PythonSitePackages REQUIRED)
2929
find_package(Libexecinfo REQUIRED)
3030
if (USE_LIBBFD)

hurricane/src/isobar/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
${Boost_INCLUDE_DIRS}
99
${Python_INCLUDE_DIRS}
1010
)
11-
find_package (Python3 COMPONENTS Interpreter Development)
1211
set( pyCpps ProxyProperty.cpp
1312
PythonAttributes.cpp
1413
PyBreakpoint.cpp

ispd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
set_cmake_policies()
1515
#setup_apple()
1616
setup_boost(program_options)
17+
setup_python()
1718

1819
set(QT_USE_QTXML "true")
1920
find_package(Qt4 REQUIRED)
20-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2121
find_package(PythonSitePackages REQUIRED)
2222
find_package(HURRICANE REQUIRED)
2323
find_package(CORIOLIS REQUIRED)

karakaze/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
check_distribution()
1616

1717
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
18-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
18+
setup_python()
1919
find_package(PythonSitePackages REQUIRED)
2020
find_package(HURRICANE REQUIRED)
2121
find_package(CORIOLIS REQUIRED)

katana/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
set_cmake_policies()
1919
setup_boost(program_options)
2020
setup_qt()
21+
setup_python()
2122

2223
find_package(Libexecinfo REQUIRED)
23-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2424
find_package(PythonSitePackages REQUIRED)
2525
find_package(LEFDEF REQUIRED)
2626
find_package(FLUTE REQUIRED)

katana/src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
${Boost_INCLUDE_DIRS}
1313
${Python_INCLUDE_DIRS}
1414
)
15-
find_package (Python3 COMPONENTS Interpreter Development)
1615
set( includes katana/Constants.h
1716
katana/Block.h
1817
katana/TrackCost.h

oroshi/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
set_cmake_policies()
1515
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
1616
setup_boost(program_options)
17+
setup_python()
1718

1819
if (USE_LIBBFD)
1920
find_package(Libbfd)
2021
endif()
21-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2222
find_package(PythonSitePackages REQUIRED)
2323
find_package(HURRICANE REQUIRED)
2424
find_package(CORIOLIS REQUIRED)

stratus1/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/")
1313
find_package(Bootstrap REQUIRED)
1414
setup_project_paths(CORIOLIS)
15+
setup_python()
1516

1617
find_package(Bootstrap REQUIRED)
1718
set_cmake_policies()
1819
# The flaw is in UseLATEX.cmake.
1920
cmake_policy(SET CMP0002 OLD)
2021
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
2122

22-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2323
find_package(PythonSitePackages REQUIRED)
2424
find_package(HURRICANE REQUIRED)
2525
find_package(CORIOLIS REQUIRED)

tramontana/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
set_cmake_policies()
1818
setup_boost()
1919
setup_qt()
20+
setup_python()
2021

21-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2222
find_package(PythonSitePackages REQUIRED)
2323
find_package(HURRICANE REQUIRED)
2424
find_package(CORIOLIS REQUIRED)

tutorial/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
set_cmake_policies()
1818
setup_boost(program_options)
1919
setup_qt()
20+
setup_python()
2021

2122
find_package(Libexecinfo REQUIRED)
22-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2323
find_package(PythonSitePackages REQUIRED)
2424
find_package(LEFDEF REQUIRED)
2525
find_package(HURRICANE REQUIRED)

unicorn/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
2020
setup_boost(program_options)
2121
setup_qt()
22+
setup_python()
2223

2324
if (USE_LIBBFD)
2425
find_package(Libbfd)
2526
endif()
2627
find_package(BZip2 REQUIRED)
27-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
2828
find_package(PythonSitePackages REQUIRED)
2929
find_package(LEFDEF REQUIRED)
3030
find_package(COLOQUINTE)

unittests/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
2222
setup_boost(program_options)
2323
setup_qt()
24+
setup_python()
2425

2526
if (USE_LIBBFD)
2627
find_package(Libbfd)
2728
endif()
2829
find_package(Libexecinfo REQUIRED)
2930
find_package(BZip2 REQUIRED)
30-
find_package(Python 3 REQUIRED COMPONENTS Interpreter Development)
3131
find_package(PythonSitePackages REQUIRED)
3232
find_package(LEFDEF)
3333
find_package(HURRICANE REQUIRED)

0 commit comments

Comments
 (0)