diff --git a/orocos-rtt-config.cmake b/orocos-rtt-config.cmake index 5a8d9d8e4..84e974b96 100644 --- a/orocos-rtt-config.cmake +++ b/orocos-rtt-config.cmake @@ -65,12 +65,12 @@ ######################################################################################################################## # Set the default target operating system, if unspecified -if(NOT DEFINED OROCOS_TARGET) - set(DOC_STRING "The Operating System target. One of [gnulinux lxrt macosx win32 xenomai]") - if(NOT $ENV{OROCOS_TARGET} STREQUAL "") - set(OROCOS_TARGET $ENV{OROCOS_TARGET} CACHE STRING "${DOC_STRING}") - message( "Detected OROCOS_TARGET environment variable. Using: ${OROCOS_TARGET}") - else() +set(DOC_STRING "The Operating System target. One of [gnulinux lxrt macosx win32 xenomai]") +if(NOT $ENV{OROCOS_TARGET} STREQUAL "") + set(OROCOS_TARGET $ENV{OROCOS_TARGET} CACHE STRING "${DOC_STRING}" FORCE) + message( "Detected OROCOS_TARGET environment variable. Using: ${OROCOS_TARGET}") +else() + if(NOT DEFINED OROCOS_TARGET) if(MSVC) set(OROCOS_TARGET win32 CACHE STRING "${DOC_STRING}") elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")