Skip to content
Permalink
Browse files

cmake: use spaces

  • Loading branch information...
FreyJo committed Oct 1, 2019
1 parent f2bc3f7 commit 1701d8e9821b067c3cbe32d7d39584699d03df28
Showing with 50 additions and 50 deletions.
  1. +50 −50 CMakeLists.txt
@@ -35,8 +35,8 @@
cmake_minimum_required(VERSION 3.1)

if(CMAKE_MAKE_PROGRAM)
file(TO_CMAKE_PATH ${CMAKE_MAKE_PROGRAM} CMAKE_MAKE_PROGRAM)
find_program(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
file(TO_CMAKE_PATH ${CMAKE_MAKE_PROGRAM} CMAKE_MAKE_PROGRAM)
find_program(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
endif()

project(acados LANGUAGES C CXX)
@@ -53,9 +53,9 @@ set(HPIPM_TARGET "AVX" CACHE STRING "HPIPM Target architecture")
set(LA "HIGH_PERFORMANCE" CACHE STRING "Linear algebra optimization level")

if (CMAKE_SYSTEM_NAME MATCHES "Windows")
set(BUILD_SHARED_LIBS OFF CACHE STRING "Build shared libraries")
set(BUILD_SHARED_LIBS OFF CACHE STRING "Build shared libraries")
else()
set(BUILD_SHARED_LIBS ON CACHE STRING "Build shared libraries")
set(BUILD_SHARED_LIBS ON CACHE STRING "Build shared libraries")
endif()

# Additional targets
@@ -83,9 +83,9 @@ set(BLASFEO_SRC_DIR ${PROJECT_SOURCE_DIR}/external/blasfeo)

# Set up build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release
CACHE STRING "Valid build types are: \
Release (default), None, Debug, WithExternalLibs, RelWithDebInfo, MinSizeRel." FORCE)
set(CMAKE_BUILD_TYPE Release
CACHE STRING "Valid build types are: \
Release (default), None, Debug, WithExternalLibs, RelWithDebInfo, MinSizeRel." FORCE)
endif()
### Defaults

@@ -94,77 +94,77 @@ message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
enable_testing(true)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(-D _GLIBCXX_USE_CXX11_ABI=0) # Needed for CasADi compatibility
add_definitions(-D _GLIBCXX_USE_CXX11_ABI=0) # Needed for CasADi compatibility
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
# MinGW, change to .lib such that mex recognizes it
set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
# MinGW, change to .lib such that mex recognizes it
set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fdiagnostics-show-option")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fdiagnostics-show-option")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fdiagnostics-show-option")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fdiagnostics-show-option")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
endif()

# Rpath handling, see https://cmake.org/Wiki/CMake_RPATH_handling#What_is_RPATH_.3F
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

if(CMAKE_BUILD_TYPE MATCHES WithExternalLibs)
set(ACADOS_WITH_HPMPC ON CACHE BOOL "Add HPMPC solver")
set(ACADOS_WITH_QORE ON CACHE BOOL "Add QORE solver")
set(ACADOS_WITH_OOQP ON CACHE BOOL "Add OOQP solver")
set(ACADOS_WITH_QPOASES ON CACHE BOOL "Add qpOASES solver")
set(ACADOS_WITH_QPDUNES ON CACHE BOOL "Add qpDUNES solver")
set(ACADOS_WITH_OSQP ON CACHE BOOL "Add OSQP solver")
set(ACADOS_WITH_HPMPC ON CACHE BOOL "Add HPMPC solver")
set(ACADOS_WITH_QORE ON CACHE BOOL "Add QORE solver")
set(ACADOS_WITH_OOQP ON CACHE BOOL "Add OOQP solver")
set(ACADOS_WITH_QPOASES ON CACHE BOOL "Add qpOASES solver")
set(ACADOS_WITH_QPDUNES ON CACHE BOOL "Add qpDUNES solver")
set(ACADOS_WITH_OSQP ON CACHE BOOL "Add OSQP solver")
endif()

## External lib checks (

if(ACADOS_WITH_HPMPC MATCHES ON AND CMAKE_C_COMPILER_ID MATCHES "MSVC")
set(ACADOS_WITH_HPMPC OFF CACHE BOOL "HPMPC solver" FORCE)
message(WARNING "HPMPC has been disabled, not compatible with ${CMAKE_C_COMPILER_ID}")
set(ACADOS_WITH_HPMPC OFF CACHE BOOL "HPMPC solver" FORCE)
message(WARNING "HPMPC has been disabled, not compatible with ${CMAKE_C_COMPILER_ID}")
endif()

if(ACADOS_WITH_OOQP MATCHES ON)

if(CMAKE_SYSTEM_NAME MATCHES "dSpace")
set(ACADOS_WITH_OOQP OFF CACHE BOOL "Add OOQP solver" FORCE)
message(WARNING "OOQP is not compatible with dSpace, OOQP is disabled")
if(CMAKE_SYSTEM_NAME MATCHES "dSpace")
set(ACADOS_WITH_OOQP OFF CACHE BOOL "Add OOQP solver" FORCE)
message(WARNING "OOQP is not compatible with dSpace, OOQP is disabled")

elseif(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/OOQP)
set(ACADOS_WITH_OOQP OFF CACHE BOOL "Add OOQP solver" FORCE)
message(WARNING "OOQP folder not found, OOQP has been disabled")
elseif(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/OOQP)
set(ACADOS_WITH_OOQP OFF CACHE BOOL "Add OOQP solver" FORCE)
message(WARNING "OOQP folder not found, OOQP has been disabled")

endif()
endif()
endif()

if(ACADOS_WITH_QORE MATCHES ON)

if(CMAKE_SYSTEM_NAME MATCHES "dSpace" OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(ACADOS_WITH_QORE OFF CACHE BOOL "Add QORE solver" FORCE)
message(WARNING "QORE is not compatible with MSVC or dSpace, QORE is has been disabled")
if(CMAKE_SYSTEM_NAME MATCHES "dSpace" OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(ACADOS_WITH_QORE OFF CACHE BOOL "Add QORE solver" FORCE)
message(WARNING "QORE is not compatible with MSVC or dSpace, QORE is has been disabled")

elseif(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/qore)
set(ACADOS_WITH_QORE OFF CACHE BOOL "Add QORE solver" FORCE)
message(WARNING "QORE folder not found, QORE has been disabled")
elseif(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/qore)
set(ACADOS_WITH_QORE OFF CACHE BOOL "Add QORE solver" FORCE)
message(WARNING "QORE folder not found, QORE has been disabled")

endif()
endif()
endif()

if(ACADOS_LINT)
if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "dSpace")
set(ACADOS_LINT OFF CACHE BOOL "Lint" FORCE)
message(WARNING "Lint has been disabled, not compatible with ${CMAKE_SYSTEM_NAME}")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "dSpace")
set(ACADOS_LINT OFF CACHE BOOL "Lint" FORCE)
message(WARNING "Lint has been disabled, not compatible with ${CMAKE_SYSTEM_NAME}")
endif()
endif()

if(ACADOS_MATLAB OR ACADOS_OCTAVE) #TODO: OR ACADOS_PYTHON
add_subdirectory(${PROJECT_SOURCE_DIR}/interfaces)
add_subdirectory(${PROJECT_SOURCE_DIR}/interfaces)
endif()

## ) External lib checks
@@ -180,29 +180,29 @@ add_subdirectory(${EXTERNAL_SRC_DIR})

# Configure examples
if(ACADOS_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(examples)
endif()

# Configure tests
if(ACADOS_UNIT_TESTS)
add_subdirectory(test)
add_subdirectory(test)
endif()

# Configure lint
if(ACADOS_LINT)
include(Lint)
include(Lint)
else()
add_custom_target(lint echo "Lint is disabled")
add_custom_target(lint echo "Lint is disabled")
endif()

# Configure Uninstall
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
# NOTE(dimitris): uninstall name clashes with submodules
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
# NOTE(dimitris): uninstall name clashes with submodules
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")

# Current config messages
message(STATUS "Target: BLASFEO is ${BLASFEO_TARGET}, HPIPM is ${HPIPM_TARGET}")

0 comments on commit 1701d8e

Please sign in to comment.
You can’t perform that action at this time.