Commit b0bddb0f authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Allow installation independantly of blaar

parent 2825707a
......@@ -13,32 +13,29 @@ cmake_minimum_required(VERSION 2.6)
project(blc_program)
add_definitions(-Wall -Wextra -Wno-multichar)
if (NOT TARGET shared_blc_core)
if (${BLAAR_DIR}) #We build inside blaar
add_subdirectory(${BLAAR_DIR}/blc/blc_core blc_core)
set(BLC_PROGRAM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
set(BLC_PROGRAM_LIBRARIES shared_blc_program ${BLC_CORE_LIBRARIES} PARENT_SCOPE)
else()
find_path (BLC_CORE_INCLUDE_DIRS NAMES blc_tools.h PATH_SUFFIXES blc) #blc_tools.h is an example. Others includes are suppose in the same place
find_library(BLC_CORE_LIBRARIES blc_core)
endif()
include_directories(include ${BLC_CORE_INCLUDE_DIRS}) #see if we can separate blc_channel
#source files
set(blc_sources src/blc_program.cpp src/blc_command.cpp)
find_library(BLC_CORE_LIBRARY blc_core)
add_library(shared_blc_program SHARED ${blc_sources})
add_library(static_blc_program STATIC ${blc_sources})
include_directories(include ${BLC_CORE_INCLUDE_DIRS})
target_link_libraries(shared_blc_program ${BLC_CORE_LIBRARIES})
set(BLC_PROGRAM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
set(BLC_PROGRAM_LIBRARIES shared_blc_program ${BLC_CORE_LIBRARIES} PARENT_SCOPE)
#Both librairies have the same name only the extension will change depending on the OS
set_target_properties(shared_blc_program PROPERTIES OUTPUT_NAME blc_program)
set_target_properties(static_blc_program PROPERTIES OUTPUT_NAME blc_program)
#Describe what will be to install or in the package
install(DIRECTORY include/ DESTINATION include)
install(TARGETS shared_blc_program shared_blc_program DESTINATION lib)
install(DIRECTORY include/ DESTINATION include/blc)
install(TARGETS shared_blc_program shared_blc_program DESTINATION lib/blc)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Arnaud Blanchard")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment