CMakeLists.txt 2.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

project(EASEA)
SET(CMAKE_STATIC_LIBRARY_PREFIX="")
INCLUDE_DIRECTORIES(libeasea/include alexyacc/include boost)

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


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


#Alexyacc static library
FILE(GLOB libalex_src alexyacc/*.cpp)
ADD_LIBRARY( libalex STATIC ${libalex_src} )


#Libeasea static library
FILE(GLOB libeasea_src libeasea/*.cpp )
ADD_LIBRARY( libeasea STATIC ${libeasea_src} ${libeasea_src_win})
SET_TARGET_PROPERTIES(libeasea PROPERTIES OUTPUT_NAME "libeasea" PREFIX "" COMPILE_FLAGS "-O3")


#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")


SET(easea_src 
        EaseaLex.cpp
        EaseaParse.cpp
        EaseaSym.cpp
        EaseaYTools.cpp)


ADD_EXECUTABLE(easea ${easea_src})
SET_TARGET_PROPERTIES(easea PROPERTIES COMPILE_FLAGS "")
TARGET_LINK_LIBRARIES(easea libeasea libalex program_options)
ADD_CUSTOM_COMMAND(TARGET easea POST_BUILD 
                    COMMAND $(CMAKE_COMMAND) -E copy libeasea.a libeasea/
                    COMMAND $(CMAKE_COMMAND) -E copy program_options.a boost/
                   )

INSTALL(TARGETS easea DESTINATION bin/ CONFIGURATIONS local)
INSTALL(TARGETS libeasea DESTINATION libeasea/ CONFIGURATIONS local)
INSTALL(TARGETS program_options DESTINATION boost/ CONFIGURATIONS local)
INSTALL(TARGETS easea DESTINATION /usr/local/easea/bin CONFIGURATIONS global)
INSTALL(TARGETS libeasea DESTINATION /usr/local/easea/libeasea CONFIGURATIONS global)
INSTALL(TARGETS program_options DESTINATION /usr/local/easea/boost CONFIGURATIONS global)
INSTALL(DIRECTORY tpl DESTINATION /usr/local/easea/ CONFIGURATIONS global)
INSTALL(DIRECTORY "libeasea/include" DESTINATION "/usr/local/easea/libeasea/" CONFIGURATIONS global)
INSTALL(DIRECTORY boost/boost DESTINATION /usr/local/easea/boost/ CONFIGURATIONS global)
INSTALL(FILES easeagrapher/EaseaGrapher.jar DESTINATION /usr/local/easea/easeagrapher CONFIGURATIONS global)