Changeset cc36b37 in OpenModelica


Ignore:
Timestamp:
2020-10-21T14:04:18+02:00 (3 years ago)
Author:
Mahder Gebremedhin <mahder.gebremedhin@…>
Children:
2e1f3837
Parents:
577c0c0b
git-author:
Mahder Gebremedhin <mahder.gebremedhin@…> (09/25/20 14:05:57)
git-committer:
Mahder Gebremedhin <mahder.gebremedhin@…> (10/21/20 14:04:18)
Message:

[cmake] Add default installation folder.

  • To avoid installing into system folder like /usr or /usr/local we add a default install dir as:

<Project_root>/install_cmake

if the user has not specified an installation directory (i.e. has not
set CMAKE_INSTALL_PREFIX when configuring)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/CMakeLists.txt

    r16b92f9d rcc36b37  
    2020omc_add_to_report(CMAKE_BUILD_TYPE)
    2121
     22# Precaution so that users do not install in system folders (e.g. /user/, /usr/local/)
     23# unintentionally. If the user has not specified anything default to an install_cmake dir in the root folder.
     24if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
     25    set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/install_cmake CACHE PATH "Default installation directory" FORCE)
     26    message(WARNING "No installation directory specified. ${CMAKE_INSTALL_PREFIX}")
     27endif()
     28omc_add_to_report(CMAKE_INSTALL_PREFIX)
     29
     30
    2231# Set the installation lib directory as an rpath for all installed
    23 # libs.
     32# libs and executables.
    2433# Maybe there is a better way to do this but it should suffice for now.
    2534SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
     
    3342omc_add_subdirectory(3rdParty)
    3443
    35 # We do this after 3rdPart is added because some libs in FMILib use implicit function declration
     44# We do this after 3rdParty is added because some libs in FMILib use implicit function declaration
    3645# because of missing #defines due to bad configuration.
    3746
Note: See TracChangeset for help on using the changeset viewer.