-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify the drake_cmake_external example
Updates to the CMakeLists include: * Use the modern method of finding Python. * Remove unnecessary subdirectory
- Loading branch information
1 parent
c93c30b
commit f0c2001
Showing
6 changed files
with
23 additions
and
42 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
33 changes: 20 additions & 13 deletions
33
drake_cmake_external/drake_external_examples/CMakeLists.txt
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,22 +1,29 @@ | ||
# SPDX-License-Identifier: MIT-0 | ||
|
||
cmake_minimum_required(VERSION 3.10.2) | ||
cmake_minimum_required(VERSION 3.16) | ||
project(drake_external_examples) | ||
|
||
include(CTest) | ||
|
||
if(APPLE) | ||
set(FIND_PYTHON_INTERP_VERSION 3.12) | ||
else() | ||
set(FIND_PYTHON_INTERP_VERSION 3.6) | ||
endif() | ||
find_package(PythonInterp ${FIND_PYTHON_INTERP_VERSION} MODULE REQUIRED) | ||
|
||
find_package(drake CONFIG REQUIRED) | ||
|
||
get_filename_component(PYTHONPATH | ||
"${drake_DIR}/../../python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" | ||
find_package(Python3 ${drake_PYTHON_VERSION} EXACT REQUIRED COMPONENTS Interpreter Development) | ||
|
||
get_filename_component(DRAKE_PYTHONPATH | ||
"${drake_DIR}/../../python${drake_PYTHON_VERSION}/site-packages" | ||
REALPATH | ||
) | ||
|
||
add_subdirectory(apps) | ||
add_executable(simple_continuous_time_system simple_continuous_time_system.cc) | ||
target_link_libraries(simple_continuous_time_system drake::drake) | ||
|
||
include(CTest) | ||
|
||
add_test(NAME simple_continuous_time_system | ||
COMMAND simple_continuous_time_system | ||
) | ||
add_test(NAME import_all_test COMMAND | ||
"${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/import_all_test.py" | ||
) | ||
set_tests_properties(import_all_test PROPERTIES | ||
ENVIRONMENT "PYTHONPATH=${DRAKE_PYTHONPATH}" | ||
) | ||
|
14 changes: 0 additions & 14 deletions
14
drake_cmake_external/drake_external_examples/apps/CMakeLists.txt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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