CMakeLists.txt 2.91 KB
Newer Older
1 2 3 4
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

project(EASEA)
SET(CMAKE_STATIC_LIBRARY_PREFIX="")
5
INCLUDE_DIRECTORIES(libeasea/include cxxopts)
6

7
ADD_DEFINITIONS(-std=c++14 -g -w -Wno-deprecated -Wno-write-strings -fmessage-length=0 )
8 9 10 11 12 13 14 15 16


if(WIN32)
  FILE(GLOB libeasea_src_win  "libeasea/win32/*.cpp" )
endif(WIN32)

#Libeasea static library
FILE(GLOB libeasea_src libeasea/*.cpp )
ADD_LIBRARY( libeasea STATIC ${libeasea_src} ${libeasea_src_win})
17
SET_TARGET_PROPERTIES(libeasea PROPERTIES OUTPUT_NAME "libeasea" PREFIX "" COMPILE_FLAGS "-std=c++14 -O3 -fopenmp")
18 19 20

find_package(BISON)
find_package(FLEX)
Thomas Kuntz's avatar
Thomas Kuntz committed
21
FLEX_TARGET(Lexer compiler/EaseaLex.l compiler/EaseaLex.cpp)
22 23
BISON_TARGET(Parser compiler/EaseaParse.y compiler/EaseaParse.cpp COMPILE_FLAGS -d)

24
#Easea compiler
25
SET(easea_src 
26 27 28 29
        compiler/EaseaLex.cpp
        compiler/EaseaParse.cpp
        compiler/EaseaSym.cpp
        compiler/EaseaYTools.cpp)
30 31 32


ADD_EXECUTABLE(easea ${easea_src})
33
ADD_DEPENDENCIES(easea Lexer Parser)
34
SET_TARGET_PROPERTIES(easea PROPERTIES COMPILE_FLAGS "")
Arnaud Kress's avatar
Arnaud Kress committed
35
TARGET_LINK_LIBRARIES(easea libeasea)
36
ADD_CUSTOM_COMMAND(TARGET easea POST_BUILD 
37
                    COMMAND $(CMAKE_COMMAND) -E copy libeasea.a libeasea/
38 39
                   )

40 41 42 43
INSTALL(TARGETS easea DESTINATION /usr/local/easea/bin )
INSTALL(TARGETS libeasea DESTINATION /usr/local/easea/libeasea )
INSTALL(DIRECTORY tpl DESTINATION /usr/local/easea )
INSTALL(DIRECTORY "libeasea/include" DESTINATION "/usr/local/easea/libeasea")
44
INSTALL(DIRECTORY examples DESTINATION /usr/local/easea/examples)
45
INSTALL(FILES easeagrapher/EaseaGrapher.jar DESTINATION /usr/local/easea/easeagrapher )
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

SET(MAJOR_VERSION 0)
SET(MINOR_VERSION 1)
SET(PATCH_VERSION 0)
 
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
INCLUDE(InstallRequiredSystemLibraries)
 
SET(CPACK_SET_DESTDIR "on")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/tmp")
SET(CPACK_GENERATOR "DEB")
 
SET(CPACK_PACKAGE_DESCRIPTION "EASEA framework")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "EASEA: A distributed and massively parallel evolutionary engine")
SET(CPACK_PACKAGE_VENDOR "University of Strasbourg")
SET(CPACK_PACKAGE_CONTACT "Pallamidessi Joseph")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
 
68 69
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.1.3), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.2.1), build-essential, openjdk-8-jre")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "postinst;prerm;")
70 71 72 73 74 75 76 77
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
 
SET(CPACK_COMPONENTS_ALL Libraries ApplicationData)
INCLUDE(CPack)
 
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")