mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
cmake: collection of fixes
This commit is contained in:
parent
629be08683
commit
ba0b2b788b
@ -36,19 +36,19 @@ else()
|
|||||||
set(RELEASE_BUILD FALSE)
|
set(RELEASE_BUILD FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BINDIR ${PROJECT_BINARY_DIR}/bin)
|
set(BINDIR "${PROJECT_BINARY_DIR}/bin")
|
||||||
set(LIBDIR ${PROJECT_BINARY_DIR}/lib)
|
set(LIBDIR "${PROJECT_BINARY_DIR}/lib")
|
||||||
|
|
||||||
# First for the generic no-config case
|
# First for the generic no-config case
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BINDIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BINDIR}")
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBDIR})
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBDIR}")
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR})
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${LIBDIR}")
|
||||||
# Second, for multi-config builds (e.g. msvc)
|
# Second, for multi-config builds (e.g. msvc)
|
||||||
foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||||
string (TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
string (TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BINDIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${BINDIR}")
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${LIBDIR})
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${LIBDIR}")
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${LIBDIR})
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${LIBDIR}")
|
||||||
endforeach (OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
|
endforeach (OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
|
||||||
|
|
||||||
|
|
||||||
@ -71,13 +71,14 @@ find_package(Boost ${BOOST_MINVERSION})
|
|||||||
if(NOT Boost_FOUND)
|
if(NOT Boost_FOUND)
|
||||||
# we might have boost in tree, so provide a hint and try again
|
# we might have boost in tree, so provide a hint and try again
|
||||||
message(STATUS "trying include dir for boost")
|
message(STATUS "trying include dir for boost")
|
||||||
set(BOOST_INCLUDEDIR ${CMAKE_SOURCE_DIR}/include)
|
set(BOOST_INCLUDEDIR "${CMAKE_SOURCE_DIR}/include")
|
||||||
find_package(Boost ${BOOST_MINVERSION})
|
find_package(Boost ${BOOST_MINVERSION})
|
||||||
if(NOT Boost_FOUND)
|
if(NOT Boost_FOUND)
|
||||||
message(FATAL_ERROR "Boost ${BOOST_MINVERSION} or later not found. Either install system pacakges if available or extract Boost headers to ${CMAKE_SOURCE_DIR}/include")
|
message(FATAL_ERROR "Boost ${BOOST_MINVERSION} or later not found. Either install system pacakges if available, extract Boost headers to ${CMAKE_SOURCE_DIR}/include, or set the CMake BOOST_ROOT variable.")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6)
|
# -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6)
|
||||||
find_package(PythonInterp)
|
find_package(PythonInterp)
|
||||||
find_program(RAGEL ragel)
|
find_program(RAGEL ragel)
|
||||||
@ -88,6 +89,10 @@ else()
|
|||||||
message(FATAL_ERROR "No python interpreter found")
|
message(FATAL_ERROR "No python interpreter found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${RAGEL} STREQUAL "RAGEL-NOTFOUND")
|
||||||
|
message(FATAL_ERROR "Ragel state machine compiler not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
option(OPTIMISE "Turns off compiler optimizations (on by default unless debug output enabled or coverage testing)" TRUE)
|
option(OPTIMISE "Turns off compiler optimizations (on by default unless debug output enabled or coverage testing)" TRUE)
|
||||||
|
|
||||||
option(DEBUG_OUTPUT "Enable debug output (warning: very verbose)" FALSE)
|
option(DEBUG_OUTPUT "Enable debug output (warning: very verbose)" FALSE)
|
||||||
@ -290,10 +295,10 @@ CHECK_CXX_COMPILER_FLAG("-Wunused-variable" CXX_WUNUSED_VARIABLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT XCODE)
|
if (NOT XCODE)
|
||||||
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
|
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
# cmake doesn't think Xcode supports isystem
|
# cmake doesn't think Xcode supports isystem
|
||||||
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -isystem ${Boost_INCLUDE_DIR}")
|
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -isystem ${Boost_INCLUDE_DIRS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,11 +13,11 @@ set(AUTOGEN_PY_FILES
|
|||||||
function(fdr_autogen type out)
|
function(fdr_autogen type out)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
COMMENT "AUTOGEN ${out}"
|
COMMENT "AUTOGEN ${out}"
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${out}
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${out}"
|
||||||
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/autogen.py ${type} > ${CMAKE_CURRENT_BINARY_DIR}/${out}
|
COMMAND ${PYTHON} "${CMAKE_CURRENT_SOURCE_DIR}/autogen.py" ${type} > "${CMAKE_CURRENT_BINARY_DIR}/${out}"
|
||||||
DEPENDS ${AUTOGEN_PY_FILES}
|
DEPENDS ${AUTOGEN_PY_FILES}
|
||||||
)
|
)
|
||||||
add_custom_target(autogen_${type} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${out})
|
add_custom_target(autogen_${type} DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${out}")
|
||||||
endfunction(fdr_autogen)
|
endfunction(fdr_autogen)
|
||||||
|
|
||||||
#now build the functions
|
#now build the functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user