-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* More extensive cmake options. * Better warning message. * Removed custom test target Older cmake versions complain about this usage.
- Loading branch information
1 parent
2f1f05a
commit 2bacdc9
Showing
7 changed files
with
98 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
################################################################################ | ||
## Basic Code | ||
subdirs(Fortran) | ||
|
||
## C++ Bindings | ||
if (NOT FORTRAN_ONLY) | ||
subdirs(C) | ||
subdirs(CPlusPlus) | ||
subdirs(Swig) | ||
subdirs(Wrapper) | ||
endif() | ||
|
||
## Python bindings built with swig | ||
if (NOT NOSWIG) | ||
subdirs(Swig) | ||
else() | ||
message(WARNING "Swig is disabled. No python bindings with be generated.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,41 @@ | ||
################################################################################ | ||
if (SWIG_FOUND) | ||
# Probe some information about python | ||
if(NOT DEFINED PYTHON_EXECUTABLE) | ||
find_package(PythonInterp REQUIRED) | ||
endif() | ||
# Probe some information about python | ||
if(NOT DEFINED PYTHON_EXECUTABLE) | ||
find_package(PythonInterp REQUIRED) | ||
endif() | ||
|
||
include(ConfigPython.cmake) | ||
if (APPLE) | ||
get_py_lib() | ||
message(STATUS "Using Python Library Path:" ${PYTHON_LIBRARIES}) | ||
endif() | ||
get_py_include() | ||
message(STATUS "Using Python Include Path:" ${PYTHON_INCLUDE_PATH}) | ||
include(ConfigPython.cmake) | ||
if (APPLE) | ||
get_py_lib() | ||
message(STATUS "Using Python Library Path:" ${PYTHON_LIBRARIES}) | ||
endif() | ||
get_py_include() | ||
message(STATUS "Using Python Include Path:" ${PYTHON_INCLUDE_PATH}) | ||
|
||
include_directories(${PYTHON_INCLUDE_PATH}) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
include_directories(${CMAKE_SOURCE_DIR}/Source/C) | ||
include_directories(${CMAKE_SOURCE_DIR}/Source/CPlusPlus) | ||
include_directories(${PYTHON_INCLUDE_PATH}) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
include_directories(${CMAKE_SOURCE_DIR}/Source/C) | ||
include_directories(${CMAKE_SOURCE_DIR}/Source/CPlusPlus) | ||
|
||
include(${SWIG_USE_FILE}) | ||
set(CMAKE_SWIG_FLAGS "") | ||
include(${SWIG_USE_FILE}) | ||
set(CMAKE_SWIG_FLAGS "") | ||
|
||
set(Swigsrc | ||
NTPolySwig.i | ||
) | ||
set(Swigsrc | ||
NTPolySwig.i | ||
) | ||
|
||
foreach(file ${Swigsrc}) | ||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES CPLUSPLUS ON) | ||
endforeach(file) | ||
set(CMAKE_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/python) | ||
if(${CMAKE_VERSION} VERSION_LESS "3.8.0") | ||
swig_add_module(NTPolySwig python ${Swigsrc}) | ||
else() | ||
swig_add_library(NTPolySwig LANGUAGE python SOURCES ${Swigsrc}) | ||
endif() | ||
swig_link_libraries(NTPolySwig NTPolyCPP NTPolyWrapper NTPoly | ||
${PYTHON_LIBRARIES} ${TOOLCHAIN_LIBS}) | ||
set_target_properties(_NTPolySwig PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/python | ||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/python | ||
) | ||
foreach(file ${Swigsrc}) | ||
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES CPLUSPLUS ON) | ||
endforeach(file) | ||
set(CMAKE_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/python) | ||
if(${CMAKE_VERSION} VERSION_LESS "3.8.0") | ||
swig_add_module(NTPolySwig python ${Swigsrc}) | ||
else() | ||
message(WARNING "Swig not found! No python bindings will be generated.") | ||
swig_add_library(NTPolySwig LANGUAGE python SOURCES ${Swigsrc}) | ||
endif() | ||
swig_link_libraries(NTPolySwig NTPolyCPP NTPolyWrapper NTPoly | ||
${PYTHON_LIBRARIES} ${TOOLCHAIN_LIBS}) | ||
set_target_properties(_NTPolySwig PROPERTIES | ||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/python | ||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/python | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters