Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
d7120792
Commit
d7120792
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
CMake: mv code to PythonAPI.cmake
parent
bd098ec1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
Core/CMakeLists.txt
+1
-40
1 addition, 40 deletions
Core/CMakeLists.txt
cmake/BornAgain/PythonAPI.cmake
+33
-0
33 additions, 0 deletions
cmake/BornAgain/PythonAPI.cmake
with
35 additions
and
40 deletions
CMakeLists.txt
+
1
−
0
View file @
d7120792
...
...
@@ -95,6 +95,7 @@ if(BORNAGAIN_GUI)
string
(
APPEND CMAKE_CXX_FLAGS
" -DHAVE_QT=ON"
)
endif
()
include
(
BornAgain/Config
)
include
(
BornAgain/PythonAPI
)
include
(
BornAgain/PythonDocs
)
# debug optimization
...
...
This diff is collapsed.
Click to expand it.
Core/CMakeLists.txt
+
1
−
40
View file @
d7120792
...
...
@@ -17,7 +17,6 @@ if(${Cerf_IS_CPP})
string
(
APPEND CMAKE_CXX_FLAGS
" -DCERF_AS_CPP=ON"
)
endif
()
if
(
BORNAGAIN_PYTHON
)
if
(
CONFIGURE_BINDINGS
)
...
...
@@ -99,34 +98,9 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
if
(
BORNAGAIN_PYTHON
)
if
(
CONFIGURE_BINDINGS
)
add_custom_command
(
OUTPUT
${
AUTO_DIR
}
/swig_runtime.h
COMMAND
${
SWIG_EXECUTABLE
}
-c++;-python;-external-runtime;
${
AUTO_DIR
}
/swig_runtime.h
DEPENDS
${
swig_dependencies
}
${
include_files
}
)
endif
()
add_custom_target
(
${
lib
}
_runtime DEPENDS
${
AUTO_DIR
}
/swig_runtime.h
)
add_dependencies
(
${
lib
}
${
lib
}
_runtime
)
configure_file
(
${
WRAP_DIR
}
/python/plot_utils.py
${
CMAKE_BINARY_DIR
}
/lib/bornagain/plot_utils.py COPYONLY
)
if
(
WIN32
)
set
(
BA_MODULES_IMPORT_PATH
"../../bin"
)
else
()
set
(
BA_MODULES_IMPORT_PATH
".."
)
endif
()
if
(
BORNAGAIN_APPLE_BUNDLE
)
set
(
BA_MODULES_IMPORT_PATH
lib/BornAgain-
${
BornAgain_VERSION_MAJOR
}
.
${
BornAgain_VERSION_MINOR
}
)
endif
()
configure_file
(
"
${
WRAP_DIR
}
/python/__init__.py.in"
"
${
CMAKE_BINARY_DIR
}
/lib/bornagain/__init__.py"
@ONLY
)
add_dependencies
(
${
lib
}
swig_runtime
)
endif
()
# --- external dependencies ---
target_link_libraries
(
${
lib
}
${
BornAgainFit_LIBRARY
}
${
CMAKE_THREAD_LIBS_INIT
}
)
...
...
@@ -180,19 +154,6 @@ foreach(file ${include_files})
install
(
FILES
${
file
}
DESTINATION
${
destination_include
}
/
${
name
}
/
${
dir
}
)
endforeach
()
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.py"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"README"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.gz"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.png"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/cpp
DESTINATION
${
destination_examples
}
COMPONENT Examples
)
install
(
FILES
"
${
AUTO_DIR
}
/swig_runtime.h"
DESTINATION
${
destination_include
}
/Wrap COMPONENT Headers
)
if
(
WIN32
)
# python in windows required .pyd extension for the library name
if
(
BORNAGAIN_PYTHON
)
...
...
This diff is collapsed.
Click to expand it.
cmake/BornAgain/PythonAPI.cmake
+
33
−
0
View file @
d7120792
# Configure and install the Swig runtime, the BornAgain Python module, and more
configure_file
(
${
WRAP_DIR
}
/python/plot_utils.py
${
CMAKE_BINARY_DIR
}
/lib/bornagain/plot_utils.py COPYONLY
)
if
(
WIN32
)
set
(
BA_MODULES_IMPORT_PATH
"../../bin"
)
else
()
set
(
BA_MODULES_IMPORT_PATH
".."
)
endif
()
if
(
BORNAGAIN_APPLE_BUNDLE
)
set
(
BA_MODULES_IMPORT_PATH
lib/BornAgain-
${
BornAgain_VERSION_MAJOR
}
.
${
BornAgain_VERSION_MINOR
}
)
endif
()
configure_file
(
"
${
WRAP_DIR
}
/python/__init__.py.in"
"
${
CMAKE_BINARY_DIR
}
/lib/bornagain/__init__.py"
@ONLY
)
if
(
CONFIGURE_BINDINGS
)
add_custom_command
(
OUTPUT
${
AUTO_DIR
}
/swig_runtime.h
COMMAND
${
SWIG_EXECUTABLE
}
-c++;-python;-external-runtime;
${
AUTO_DIR
}
/swig_runtime.h
DEPENDS
${
swig_dependencies
}
${
include_files
}
)
endif
()
add_custom_target
(
swig_runtime DEPENDS
${
AUTO_DIR
}
/swig_runtime.h
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.py"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"README"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.gz"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/
DESTINATION
${
destination_examples
}
COMPONENT Examples FILES_MATCHING PATTERN
"*.png"
)
install
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Examples/cpp
DESTINATION
${
destination_examples
}
COMPONENT Examples
)
install
(
FILES
"
${
AUTO_DIR
}
/swig_runtime.h"
DESTINATION
${
destination_include
}
/Wrap COMPONENT Headers
)
# Install bornagain/__init__.py and utilites
install
(
DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/lib/bornagain/"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment