From 1f7dd5a5bcbce29cbb99af193304f7cd7f216367 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Sat, 25 Mar 2017 12:03:52 +0000 Subject: [PATCH] Improve companion CMake programs name condition (#4684) * Refactor condition to avoid repeating the test in `else' and `endif'; * Suffix programs name with `${C9X_NAME_SUFFIX}' under FreeBSD, as for Linux build, else cmake build is failing because a `companion' directory already exist in the build directory. --- companion/src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index b63eb5edf..65cfe06ba 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -1,6 +1,6 @@ set(SIMULATOR_INSTALL_PREFIX "" CACHE STRING "Alternative simulator library search path") -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +if(${CMAKE_SYSTEM_NAME} MATCHES "(Linux|FreeBSD)") set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR}) set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}") set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}") @@ -11,10 +11,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() message(STATUS "Simulators library search path: " ${SIMULATOR_LIB_PATH}) set(SIMULATOR_LIB_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX}) -else(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +else() set(COMPANION_NAME "companion") set(SIMULATOR_NAME "simulator") -endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +endif() # This the name that the user will see in the generated DMG and what the application # will be called under /Applications. We include the version string to make installing