Skip to content

Commit

Permalink
Configure MSVC x64 builds when appropriate.
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Jul 23, 2020
1 parent 75cd96b commit 3dac1fd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Expand Up @@ -7,6 +7,12 @@ find_package(ament_cmake REQUIRED)
macro(build_mimick)

set(extra_cmake_args)
if(WIN32)
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(x86_|x86-|AMD|amd|x)64$")
list(APPEND extra_cmake_args -A x64)
endif()
endif()

if(DEFINED CMAKE_BUILD_TYPE)
list(APPEND extra_cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
Expand Down Expand Up @@ -39,15 +45,15 @@ macro(build_mimick)
else()
list(APPEND extra_cmake_args "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
endif()

include(ExternalProject)
externalproject_add(mimick-ext
GIT_REPOSITORY https://github.com/hidmic/Mimick
GIT_TAG hidmic/cxx-compatibility
TIMEOUT 6000
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install
${extra_cmake_args}
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install
${extra_cmake_args}
)

# The external project will install to the build folder, but we'll install that on make install.
Expand Down

0 comments on commit 3dac1fd

Please sign in to comment.