Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
d830a29a
Commit
d830a29a
authored
15 years ago
by
Marcel Loose
Browse files
Options
Downloads
Patches
Plain Diff
Bug 1310: Make sure there's a __init__.py in each build directory *and* each install directory.
parent
20304e83
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMake/FindPython.cmake
+1
-1
1 addition, 1 deletion
CMake/FindPython.cmake
CMake/PythonInstall.cmake
+12
-9
12 additions, 9 deletions
CMake/PythonInstall.cmake
with
13 additions
and
10 deletions
CMake/FindPython.cmake
+
1
−
1
View file @
d830a29a
...
...
@@ -46,7 +46,7 @@ find_package(PythonLibs ${_options})
if
(
NOT PYTHON_FOUND
)
if
(
PYTHON_EXECUTABLE
)
set
(
_cmd
"from distutils.sysconfig import
*
"
"from distutils.sysconfig import
get_python_lib
"
"print get_python_lib(prefix='')"
)
execute_process
(
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
"-c"
"
${
_cmd
}
"
...
...
This diff is collapsed.
Click to expand it.
CMake/PythonInstall.cmake
+
12
−
9
View file @
d830a29a
...
...
@@ -53,15 +53,6 @@ macro(python_install)
set
(
_inst_dir
"
${
PYTHON_INSTALL_DIR
}
/
${
_dest_dir
}
"
)
set
(
_build_dir
"
${
PYTHON_BUILD_DIR
}
/
${
_dest_dir
}
"
)
# Make sure that there's a __init__.py file in each directory
string
(
REGEX REPLACE
"/"
";"
_dir_list
${
_dest_dir
}
)
set
(
_init_dir
"
${
PYTHON_BUILD_DIR
}
"
)
foreach
(
_dir
${
_dir_list
}
)
set
(
_init_dir
"
${
_init_dir
}
/
${
_dir
}
"
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
_init_dir
}
/__init__.py"
)
endforeach
(
_dir
${
_dir_list
}
)
# Install and byte-compile each Python file.
foreach
(
_py
${
_py_files
}
)
get_filename_component
(
_src_dir
${
_py
}
ABSOLUTE
)
...
...
@@ -76,4 +67,16 @@ macro(python_install)
"execute_process(COMMAND
${
PYTHON_EXECUTABLE
}
-c
\"
${
_py_code
}
\"
)"
)
endforeach
(
_py
${
_py_files
}
)
# Make sure that there's a __init__.py file in each build/install directory
string
(
REGEX REPLACE
"/"
";"
_dir_list
${
_dest_dir
}
)
set
(
_init_dir
)
foreach
(
_dir
${
_dir_list
}
)
set
(
_init_dir
"
${
_init_dir
}
/
${
_dir
}
"
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
PYTHON_BUILD_DIR
}${
_init_dir
}
/__init__.py"
)
install
(
CODE
"execute_process(COMMAND
${
CMAKE_COMMAND
}
-E touch
\"
${
PYTHON_INSTALL_DIR
}${
_init_dir
}
/__init__.py
\"
)"
)
endforeach
(
_dir
${
_dir_list
}
)
endmacro
(
python_install
)
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