Commit 5bd77a74 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Homogenisation

parent 92fbf713
......@@ -9,48 +9,34 @@
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
if(NOT BLC_PROGRAM_LOADED)
set(BLC_PROGRAM_LOADED "LOADED" PARENT_SCOPE)
cmake_minimum_required(VERSION 2.6)
project(blc_program)
add_definitions(-Wall -Wextra -Wno-multichar)
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()
add_subdirectory(${BLAAR_DIR}/blc_core blc_core)
#source files
set(blc_sources src/blc_program.cpp src/blc_command.cpp)
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})
#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
set(sources src/blc_program.cpp src/blc_command.cpp)
add_library(blc_program SHARED ${sources})
include_directories(include ${BL_INCLUDE_DIRS})
target_link_libraries(blc_program ${BL_LIBRARIES})
add_subdirectory(exclude_from_all EXCLUDE_FROM_ALL)
#Describe where are the includes
set(BL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ${BL_INCLUDE_DIRS} PARENT_SCOPE)
set(BL_LIBRARIES blc_program ${BLC_LIBRARIES} PARENT_SCOPE)
install(DIRECTORY include/ DESTINATION include/blc)
install(TARGETS shared_blc_program shared_blc_program DESTINATION lib/blc)
install(TARGETS blc_program DESTINATION lib/blc)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Arnaud Blanchard")
include(CPack)
#Building examples
#add_executable(blc_demo examples/blc_demo.c)
#Add a target to generate documentation
#find_package(Doxygen)
#if(DOXYGEN_FOUND)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in doxyfile.doxy) #Replace the CMAKE variables in the Doxyfile
#add_custom_target(doc_${PROJECT_NAME} ALL ${DOXYGEN_EXECUTABLE} doxyfile.doxy COMMENT "Generating API documentation with Doxygen" VERBATIM )
#else(DOXYGEN_FOUND)
#message("You need to install doxygen to generate the doc.")
#endif(DOXYGEN_FOUND)
endif()
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