Skip to content

Commit

Permalink
allow setting CMAKE_INSTALL_PREFIX externally (OpenEtherCATsociety#86)
Browse files Browse the repository at this point in the history
looks fine
  • Loading branch information
hefloryd authored and nakarlsson committed Mar 31, 2017
1 parent 15e7748 commit fb975cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions test/linux/simple_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit fb975cb

Please sign in to comment.