Skip to content

Commit

Permalink
Merge pull request #2 from Thoemi09/DEV_CMAKE
Browse files Browse the repository at this point in the history
Use GNUInstallDirs more consistently
  • Loading branch information
Wentzell authored Oct 22, 2024
2 parents 2c94a93 + 7726821 commit 8ea8c90
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions c2py_flags.py.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!@Python_EXECUTABLE@

cxxflags = "-I@CMAKE_INSTALL_PREFIX@/include "
ldflags = " -L@CMAKE_INSTALL_PREFIX@/lib -lc2py "
cxxflags = "-I@CMAKE_INSTALL_FULL_INCLUDEDIR@ "
ldflags = " -L@CMAKE_INSTALL_FULL_LIBDIR@ -lc2py "

if __name__ == "__main__" :
if __name__ == "__main__" :
print("%s %s -fPIC %s "%(cxxflags, ldflags, "@c2py_all_python_flags@"))

9 changes: 4 additions & 5 deletions share/c2py.modulefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ setenv C2PY_ROOT $root
setenv C2PY_VERSION $version
setenv C2PY_GIT_HASH $git_hash

prepend-path PATH $root/bin
prepend-path CPLUS_INCLUDE_PATH $root/include
prepend-path LIBRARY_PATH $root/lib
prepend-path PYTHONPATH $root/@PYTHON_LIB_DEST_ROOT@
prepend-path CMAKE_PREFIX_PATH $root/lib/cmake/c2py
prepend-path PATH @CMAKE_INSTALL_FULL_BINDIR@
prepend-path CPLUS_INCLUDE_PATH @CMAKE_INSTALL_FULL_INCLUDEDIR@
prepend-path LIBRARY_PATH @CMAKE_INSTALL_FULL_LIBDIR@
prepend-path CMAKE_PREFIX_PATH @CMAKE_INSTALL_FULL_LIBDIR@/cmake/c2py
9 changes: 4 additions & 5 deletions share/c2pyvars.sh.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source this in your environment.

export CPLUS_INCLUDE_PATH=@CMAKE_INSTALL_PREFIX@/include:$CPLUS_INCLUDE_PATH
export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
export LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LIBRARY_PATH
export PYTHONPATH=@CMAKE_INSTALL_PREFIX@/@PYTHON_LIB_DEST_ROOT@:$PYTHONPATH
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/lib/cmake/C2Py:$CMAKE_PREFIX_PATH
export CPLUS_INCLUDE_PATH=@CMAKE_INSTALL_FULL_INCLUDEDIR@:$CPLUS_INCLUDE_PATH
export PATH=@CMAKE_INSTALL_FULL_BINDIR@:$PATH
export LIBRARY_PATH=@CMAKE_INSTALL_FULL_LIBDIR@:$LIBRARY_PATH
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_FULL_LIBDIR@/cmake/c2py:$CMAKE_PREFIX_PATH
2 changes: 1 addition & 1 deletion share/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/c2py-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/c2py-config-version.cmake
DESTINATION lib/cmake/c2py
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/c2py
)

install(EXPORT c2py-targets NAMESPACE c2py:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/c2py)
4 changes: 2 additions & 2 deletions share/cmake/c2py-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ set(c2py_ROOT @CMAKE_INSTALL_PREFIX@ CACHE PATH "Root of c2py")

# Mac specific
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_INSTALL_NAME_DIR "@CMAKE_INSTALL_PREFIX@/lib")
set(CMAKE_INSTALL_NAME_DIR "@CMAKE_INSTALL_FULL_LIBDIR@")
set(CMAKE_MACOSX_RPATH 1) # new for cmake 3.x
endif()

# include the exported targets of this project
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/c2py/c2py-targets.cmake)
include(@CMAKE_INSTALL_FULL_LIBDIR@/cmake/c2py/c2py-targets.cmake)

#SET(C2PY_C2PY_MODULE_EXTENSION "wrap.cxx")

Expand Down

0 comments on commit 8ea8c90

Please sign in to comment.