yasm/CMakeLists.txt
Peter Johnson b7f2fbc64f Add cmake build infrastructure.
Not default nor even distributed in the .tar.gz, the cmake build allows for
loadable yasm plugins by building libyasm as a shared library.
Example plugins are in the plugins/ directory, and may be loaded into a
cmake-built yasm using the -N command line option (non-cmake builds will
not have this option).

Tested only on Linux so far, but should be relatively painless to port to
Windows thanks to the use of cmake rather than libtool to create shared
libraries.

The only modification to the main source tree is some conditional-compiled
additions to yasm.c.

svn path=/trunk/yasm/; revision=2098
2008-05-22 09:08:03 +00:00

47 lines
1.2 KiB
CMake

PROJECT(yasm)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(BUILD_SHARED_LIBS ON)
# Where to look first for cmake modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
INCLUDE(YasmMacros)
OPTION(ENABLE_NLS "Enable message translations" OFF)
OPTION(YASM_BUILD_TESTS "Enable building of tests" ON)
IF(YASM_BUILD_TESTS)
ENABLE_TESTING()
ENDIF(YASM_BUILD_TESTS)
# Default build type to debug if not set
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
set (YASM_VERSION_MAJOR 0)
set (YASM_VERSION_MINOR 6)
set (YASM_VERSION_SUBMINOR 99)
set (PACKAGE_INTVER "${YASM_VERSION_MAJOR}.${YASM_VERSION_MINOR}.${YASM_VERSION_SUBMINOR}")
set (PACKAGE_BUILD "HEAD")
set (PACKAGE_VERSION ${PACKAGE_BUILD})
set (PACKAGE_STRING "yasm ${PACKAGE_VERSION}")
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR})
INCLUDE(ConfigureChecks.cmake)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(libyasm)
ADD_SUBDIRECTORY(modules)
ADD_SUBDIRECTORY(frontends)
INSTALL(FILES
libyasm.h
${CMAKE_BINARY_DIR}/libyasm-stdint.h
DESTINATION include
)