mirror of
https://github.com/triqs/dft_tools
synced 2024-10-31 19:23:45 +01:00
9c258fa7e1
I added a version.hpp and updated the version.py so that one can find the version of the library either from the c++ or the python (if there is python support). modified: CMakeLists.txt modified: cmake/TRIQSConfig.cmake.in modified: pytriqs/version.py.in modified: triqs/CMakeLists.txt new file: triqs/version.hpp.in
42 lines
1.4 KiB
CMake
42 lines
1.4 KiB
CMake
# Add C11 flag
|
|
# leave it here because boost has to be compiled without the flags because of boost python ??
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
|
|
# all .cpp files to get the dependencies
|
|
FILE(GLOB_RECURSE ALLSOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
|
FOREACH(CPP ${ALLSOURCES})
|
|
set_property (GLOBAL APPEND PROPERTY TRIQS_LIB_CPP_SOURCES_LIST "${CMAKE_CURRENT_SOURCE_DIR}/${CPP}")
|
|
ENDFOREACH(CPP ${ALLSOURCES})
|
|
get_property(ALLSOURCES GLOBAL PROPERTY TRIQS_LIB_CPP_SOURCES_LIST)
|
|
|
|
# compile every subdirectory
|
|
add_all_subdirectories_with_cmakelist()
|
|
|
|
# The lib will be build from the sources
|
|
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
SET( LINK_RT "")
|
|
else()
|
|
SET( LINK_RT "-lrt")
|
|
endif()
|
|
add_library(triqs ${ALLSOURCES})
|
|
target_link_libraries (triqs ${LINK_RT} ${TRIQS_LINK_LIBS} )
|
|
|
|
# Install library
|
|
install(TARGETS triqs DESTINATION lib)
|
|
|
|
# Version file
|
|
configure_file(version.hpp.in version.hpp @ONLY)
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/version.hpp" DESTINATION "include/triqs/")
|
|
|
|
# all .hpp files...
|
|
FILE(GLOB_RECURSE ALLHEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.hpp)
|
|
|
|
# Install headers in good include dir
|
|
FOREACH(HEADER ${ALLHEADERS})
|
|
get_filename_component(P ${HEADER} PATH)
|
|
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}" DESTINATION "include/triqs/${P}")
|
|
#MESSAGE(STATUS "I will install ${HEADER} of ${P}")
|
|
ENDFOREACH(HEADER ${ALLHEADERS})
|
|
|
|
|