Skip to content

Commit

Permalink
cmake: introduce LIB_INSTALL_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
sorki committed May 26, 2016
1 parent 2254f21 commit fdaedbd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 0)

if(DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR})
else(DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif(DEFINED LIB_INSTALL_DIR)
message(STATUS "LIB_INSTALL_DIR: " ${LIB_INSTALL_DIR})

#---------- put subdirs down here so that the package version vars above are visible to them -----------
add_subdirectory( interface )
add_subdirectory( tinyxml )
Expand Down
2 changes: 1 addition & 1 deletion interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ add_library( heeksintf SHARED ${heeksintf_SRCS} )
target_link_libraries( heeksintf ${PYTHON_LIBRARIES} ${wxWidgets_LIBRARIES} ${libarea_LIBRARIES} )

set_target_properties( heeksintf PROPERTIES SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} )
install( TARGETS heeksintf DESTINATION lib )
install( TARGETS heeksintf DESTINATION ${LIB_INSTALL_DIR} )

file( GLOB sources ${heeksintf_SRCS} ${heeksintf_HDRS} )
install( FILES ${sources} DESTINATION "share/heekscad/interface" COMPONENT heeksintf )
2 changes: 1 addition & 1 deletion tinyxml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_link_libraries( heekstinyxml ${PYTHON_LIBRARIES} )

set_target_properties( heekstinyxml PROPERTIES SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} )

install( TARGETS heekstinyxml DESTINATION lib )
install(TARGETS heekstinyxml DESTINATION ${LIB_INSTALL_DIR} )

file( GLOB sources ${heekstinyxml_HDRS} )
# FIXME: to install in right directory (ie. include/heekstinyxml), sources must be updated to use "heekstinyxml/tinyxml.h"
Expand Down

0 comments on commit fdaedbd

Please sign in to comment.