CMakeLists.txt 1.96 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 boost)
6 7 8 9 10 11 12 13 14 15 16

ADD_DEFINITIONS(-g -w -Wno-deprecated -Wno-write-strings -fmessage-length=0 )


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})
Joseph Pallamidessi's avatar
Joseph Pallamidessi committed
17
SET_TARGET_PROPERTIES(libeasea PROPERTIES OUTPUT_NAME "libeasea" PREFIX "" COMPILE_FLAGS "-O3 -fopenmp")
18 19 20 21 22 23 24


#Boost program_options static library
FILE(GLOB boost_src boost/*.cpp)
ADD_LIBRARY( program_options STATIC ${boost_src} )
SET_TARGET_PROPERTIES(program_options PROPERTIES OUTPUT_NAME "program_options" PREFIX "" COMPILE_FLAGS "-O2")

25 26 27

find_package(BISON)
find_package(FLEX)
28
FLEX_TARGET(Lexer compiler/EaseaLex.l compiler/EaseaLex.cpp COMPILE_FLAGS -i)
29 30
BISON_TARGET(Parser compiler/EaseaParse.y compiler/EaseaParse.cpp COMPILE_FLAGS -d)

31
#Easea compiler
32
SET(easea_src 
33 34 35 36
        compiler/EaseaLex.cpp
        compiler/EaseaParse.cpp
        compiler/EaseaSym.cpp
        compiler/EaseaYTools.cpp)
37 38 39


ADD_EXECUTABLE(easea ${easea_src})
40
ADD_DEPENDENCIES(easea Lexer Parser)
41
SET_TARGET_PROPERTIES(easea PROPERTIES COMPILE_FLAGS "")
42
TARGET_LINK_LIBRARIES(easea libeasea program_options)
43
ADD_CUSTOM_COMMAND(TARGET easea POST_BUILD 
44
                    COMMAND $(CMAKE_COMMAND) -E copy libeasea.a libeasea/ 
45 46 47
                    COMMAND $(CMAKE_COMMAND) -E copy program_options.a boost/
                   )

48 49 50 51 52 53 54
INSTALL(TARGETS easea DESTINATION /usr/local/easea/bin )
INSTALL(TARGETS libeasea DESTINATION /usr/local/easea/libeasea )
INSTALL(TARGETS program_options DESTINATION /usr/local/easea/boost )
INSTALL(DIRECTORY tpl DESTINATION /usr/local/easea )
INSTALL(DIRECTORY "libeasea/include" DESTINATION "/usr/local/easea/libeasea")
INSTALL(DIRECTORY boost/boost DESTINATION /usr/local/easea/boost)
INSTALL(FILES easeagrapher/EaseaGrapher.jar DESTINATION /usr/local/easea/easeagrapher )