-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove numpy dependency. Add c++ interface instructions.
- Loading branch information
1 parent
aa6424d
commit b6b091e
Showing
22 changed files
with
185 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# This CMakeLists.txt file is only for use with C++ projects and not used by setup.py | ||
# See also https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html | ||
cmake_minimum_required(VERSION 3.20) | ||
project(wlplan) | ||
|
||
# make cache variables for install destinations | ||
include(GNUInstallDirs) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -pedantic -fPIC -O3 -DNDEBUG -fomit-frame-pointer") | ||
|
||
# Gather source files | ||
# Do NOT glob src/main.cpp because that is only for creating Python bindings and requires pybind11 | ||
file(GLOB_RECURSE SRC_FILES "src/**/*.cpp") | ||
|
||
# Define the library target | ||
add_library(wlplan ${SRC_FILES}) | ||
|
||
# Specify include directories for the target | ||
target_include_directories(wlplan PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
|
||
# Export the targets to a file | ||
install(TARGETS wlplan | ||
EXPORT wlplanTargets | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
) | ||
|
||
# Create and install the package configuration file | ||
include(CMakePackageConfigHelpers) | ||
|
||
# Generate the version file for the config file | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/wlplanConfigVersion.cmake" | ||
VERSION "${WLPLAN_VERSION}" | ||
COMPATIBILITY ExactVersion | ||
) | ||
|
||
# Create config file | ||
configure_package_config_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/wlplanConfig.cmake" | ||
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wlplan" | ||
) | ||
|
||
# Install the config files | ||
install( | ||
FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/wlplanConfig.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/wlplanConfigVersion.cmake" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wlplan" | ||
) | ||
|
||
# Export and install the targets | ||
install( | ||
EXPORT wlplanTargets | ||
FILE wlplanTargets.cmake | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/wlplan" | ||
) |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
import argparse | ||
import subprocess | ||
|
||
exec(open("wlplan/__version__.py").read()) | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("installation_path", type=str) | ||
args = parser.parse_args() | ||
|
||
subprocess.check_call(["cmake", "-S", ".", "-B", "build", f"-DWLPLAN_VERSION={__version__}"]) | ||
subprocess.check_call(["cmake", "--build", "build", "-j32"]) | ||
subprocess.check_call(["cmake", "--install", "build", "--prefix", args.installation_path]) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
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
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
Oops, something went wrong.