allow setting CMAKE_INSTALL_PREFIX externally (#86)

looks fine
pull/106/head
Hans-Erik Floryd 2017-03-31 17:47:20 +02:00 committed by nakarlsson
parent 15e7748198
commit fb975cbc70
2 changed files with 5 additions and 7 deletions

View File

@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
project(SOEM C)
if(DEFINED HOST_INSTALL)
set(SOEM_INCLUDE_INSTALL_DIR include/soem)
else()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Default to installing in SOEM source directory
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install)
set(SOEM_INCLUDE_INSTALL_DIR include)
endif()
set(SOEM_INCLUDE_INSTALL_DIR include/soem)
message("CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}")
if(WIN32)

View File

@ -9,6 +9,4 @@ elseif(UNIX)
target_link_libraries(simple_test pthread rt)
endif()
if(NOT DEFINED HOST_INSTALL)
install(TARGETS simple_test DESTINATION bin)
endif()
install(TARGETS simple_test DESTINATION bin)