Skip to content

Commit

Permalink
Always use Unix Makefiles generator for Fortran projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Sep 13, 2016
1 parent 9c1ee22 commit dcd9ec3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ endif()
# BEGIN external projects

# External projects in order of dependencies; 'trivial' ones first
drake_add_external(avl PUBLIC CMAKE)
drake_add_external(bertini)
drake_add_external(bullet PUBLIC CMAKE)
drake_add_external(eigen PUBLIC CMAKE)
Expand All @@ -120,9 +119,12 @@ drake_add_external(snopt CMAKE)
drake_add_external(spdlog PUBLIC CMAKE)
drake_add_external(spotless PUBLIC CMAKE)
drake_add_external(swigmake PUBLIC CMAKE)
drake_add_external(xfoil PUBLIC CMAKE)
drake_add_external(yalmip PUBLIC)

# avl
# The Ninja generator does not support Fortran.
drake_add_external(avl PUBLIC CMAKE GENERATOR "Unix Makefiles")

# cmake
drake_add_external(cmake PUBLIC ALWAYS
BUILD_COMMAND :
Expand Down Expand Up @@ -261,6 +263,10 @@ drake_add_external(director PUBLIC CMAKE
drake_add_external(signalscope PUBLIC
DEPENDS director)

# xfoil
# The Ninja generator does not support Fortran.
drake_add_external(xfoil PUBLIC CMAKE GENERATOR "Unix Makefiles")

# drake: For drake, list both compilation AND RUNTIME dependencies. Runtime
# dependencies are needed because the drake project must configure only after
# any dependencies used by MATLAB have been installed.
Expand Down
10 changes: 8 additions & 2 deletions cmake/externals.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ macro(drake_add_cmake_external PROJECT)
INDEPENDENT_STEP_TARGETS update
BUILD_ALWAYS 1
DEPENDS ${_ext_deps}
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_GENERATOR "${_ext_GENERATOR}"
CMAKE_ARGS
${_ext_VERBOSE}
${_ext_PROPAGATE_CACHE}
Expand Down Expand Up @@ -249,6 +249,7 @@ endmacro()
# SOURCE_SUBDIR <dir> - Specify SOURCE_SUBDIR for external
# SOURCE_DIR <dir> - Override default SOURCE_DIR for external
# BINARY_DIR <dir> - Override default BINARY_DIR for external
# GENERATOR <gen> - Override default CMAKE_GENERATOR for external
#
# PATCH_COMMAND <args...>
# CONFIGURE_COMMAND <args...>
Expand Down Expand Up @@ -280,6 +281,7 @@ function(drake_add_external PROJECT)
SOURCE_SUBDIR
SOURCE_DIR
BINARY_DIR
GENERATOR
)
set(_ext_mv_args
CMAKE_ARGS
Expand All @@ -290,6 +292,10 @@ function(drake_add_external PROJECT)
cmake_parse_arguments(_ext
"${_ext_flags}" "${_ext_sv_args}" "${_ext_mv_args}" ${ARGN})

if(NOT _ext_GENERATOR)
set(_ext_GENERATOR "${CMAKE_GENERATOR}")
endif()

string(TOUPPER WITH_${PROJECT} _ext_project_option)
if(_ext_ALWAYS)
# Project is "always" enabled, but add a hidden option to turn it off; this
Expand Down Expand Up @@ -381,7 +387,7 @@ function(drake_add_external PROJECT)

# Add external to download dependencies
add_dependencies(download-all ${PROJECT}-update)
elseif(CMAKE_GENERATOR STREQUAL "Ninja" AND CMAKE_VERSION VERSION_LESS 3.7)
elseif(_ext_GENERATOR STREQUAL "Ninja" AND CMAKE_VERSION VERSION_LESS 3.7)
# Due to a quirk of how the CMake Ninja generator computes dependencies,
# all targets that contain a submodule update command, or depend on a
# target that does, need to depend on the submodule-sync target, or the
Expand Down

0 comments on commit dcd9ec3

Please sign in to comment.