Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06c791b764 | ||
|
|
76ed837546 | ||
|
|
1cad8fcbe3 | ||
|
|
f21f329b16 | ||
|
|
69297ea941 | ||
|
|
46f742eb84 | ||
|
|
7572914650 |
+144
-1216
File diff suppressed because it is too large
Load Diff
@@ -347,18 +347,6 @@ respectively.
|
||||
CONFIGURATION OPTIONS
|
||||
---------------------
|
||||
|
||||
--- BRLCAD_BUNDLED_LIBS ---
|
||||
|
||||
Enables compilation of all 3rd party sources that are provided within a BRL-CAD
|
||||
source distribution. If used this option sets all other 3rd party library
|
||||
build flags to ON by default. However, that setting can be overridden by
|
||||
manually setting individual variables. Default is "AUTO" - 3rd party sources
|
||||
are compiled only if they are not detected as being available and functioning
|
||||
as expected.
|
||||
|
||||
Aliases: ENABLE_ALL
|
||||
|
||||
|
||||
--- BRLCAD_ENABLE_OPENGL ---
|
||||
|
||||
Enable support for OpenGL based Display Managers in BRL-CAD.
|
||||
@@ -450,6 +438,18 @@ permissions).
|
||||
Aliases: ENABLE_DOCS, ENABLE_EXTRA_DOCS, ENABLE_DOCBOOK
|
||||
|
||||
|
||||
--- BRLCAD_BUNDLED_LIBS ---
|
||||
|
||||
Enables compilation of all 3rd party sources that are provided within a BRL-CAD
|
||||
source distribution. If used this option sets all other 3rd party library
|
||||
build flags to ON by default. However, that setting can be overridden by
|
||||
manually setting individual variables. Default is "AUTO" - 3rd party sources
|
||||
are compiled only if they are not detected as being available and functioning
|
||||
as expected.
|
||||
|
||||
Aliases: ENABLE_ALL
|
||||
|
||||
|
||||
--- BRLCAD_LEMON ---
|
||||
|
||||
Option for enabling and disabling compilation of the lemon parser
|
||||
|
||||
@@ -10,10 +10,6 @@ while [ "$1" != "" ]
|
||||
do
|
||||
case $1
|
||||
in
|
||||
--enable-all) options="$options -DBRLCAD_BUNDLED_LIBS=ON";
|
||||
shift;;
|
||||
--disable-all) options="$options -DBRLCAD_BUNDLED_LIBS=OFF";
|
||||
shift;;
|
||||
--enable-opengl) options="$options -DBRLCAD_ENABLE_OPENGL=ON";
|
||||
shift;;
|
||||
--disable-opengl) options="$options -DBRLCAD_ENABLE_OPENGL=OFF";
|
||||
@@ -90,6 +86,10 @@ do
|
||||
shift;;
|
||||
--disable-docbook) options="$options -DBRLCAD_EXTRADOCS=OFF";
|
||||
shift;;
|
||||
--enable-all) options="$options -DBRLCAD_BUNDLED_LIBS=ON";
|
||||
shift;;
|
||||
--disable-all) options="$options -DBRLCAD_BUNDLED_LIBS=OFF";
|
||||
shift;;
|
||||
--enable-lemon) options="$options -DBRLCAD_LEMON=BUNDLED";
|
||||
shift;;
|
||||
--disable-lemon) options="$options -DBRLCAD_LEMON=SYSTEM";
|
||||
|
||||
@@ -57,106 +57,102 @@ define_property(GLOBAL PROPERTY CMAKE_IGNORE_FILES BRIEF_DOCS "distcheck ignore
|
||||
define_property(GLOBAL PROPERTY CMAKE_IGNORE_DIRS BRIEF_DOCS "distcheck ignore dirs" FULL_DOCS "List of directories marked as fully known to CMake")
|
||||
|
||||
macro(CMAKEFILES)
|
||||
if(NOT BRLCAD_IS_SUBBUILD)
|
||||
foreach(ITEM ${ARGN})
|
||||
set(CMAKEFILES_DO_TEST 1)
|
||||
# The build targets will use certain keywords for arguments -
|
||||
# before we proceed to do any ignoring based on those names,
|
||||
# make sure the file is there. Normally attempting to ignore
|
||||
# a non-existent file is a fatal error, but these keywords
|
||||
# don't necessarily refer to files.
|
||||
set(TARGET_FLAGS SHARED STATIC OBJECT WIN32 UNKNOWN IMPORTED MODULE INTERFACE)
|
||||
foreach(TARGET_FLAG ${TARGET_FLAGS})
|
||||
if("${TARGET_FLAG}" STREQUAL "${ITEM}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set(CMAKEFILES_DO_TEST 0)
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif("${TARGET_FLAG}" STREQUAL "${ITEM}")
|
||||
endforeach(TARGET_FLAG ${TARGET_FLAGS})
|
||||
set(FUZZY_TARGET_FLAGS TARGET_OBJECTS)
|
||||
foreach(TARGET_FLAG ${FUZZY_TARGET_FLAGS})
|
||||
if("${ITEM}" MATCHES "${TARGET_FLAG}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set(CMAKEFILES_DO_TEST 0)
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif("${ITEM}" MATCHES "${TARGET_FLAG}")
|
||||
endforeach(TARGET_FLAG ${FUZZY_TARGET_FLAGS})
|
||||
foreach(ITEM ${ARGN})
|
||||
set(CMAKEFILES_DO_TEST 1)
|
||||
# The build targets will use certain keywords for arguments -
|
||||
# before we proceed to do any ignoring based on those names,
|
||||
# make sure the file is there. Normally attempting to ignore
|
||||
# a non-existent file is a fatal error, but these keywords
|
||||
# don't necessarily refer to files.
|
||||
set(TARGET_FLAGS SHARED STATIC OBJECT WIN32 UNKNOWN IMPORTED MODULE INTERFACE)
|
||||
foreach(TARGET_FLAG ${TARGET_FLAGS})
|
||||
if("${TARGET_FLAG}" STREQUAL "${ITEM}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set(CMAKEFILES_DO_TEST 0)
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif("${TARGET_FLAG}" STREQUAL "${ITEM}")
|
||||
endforeach(TARGET_FLAG ${TARGET_FLAGS})
|
||||
set(FUZZY_TARGET_FLAGS TARGET_OBJECTS)
|
||||
foreach(TARGET_FLAG ${FUZZY_TARGET_FLAGS})
|
||||
if("${ITEM}" MATCHES "${TARGET_FLAG}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set(CMAKEFILES_DO_TEST 0)
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif("${ITEM}" MATCHES "${TARGET_FLAG}")
|
||||
endforeach(TARGET_FLAG ${FUZZY_TARGET_FLAGS})
|
||||
|
||||
# Handled target flags, proceeding with tests.
|
||||
if(CMAKEFILES_DO_TEST)
|
||||
get_filename_component(ITEM_PATH "${ITEM}" PATH)
|
||||
get_filename_component(ITEM_NAME "${ITEM}" NAME)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
# If the build directory is not the same as the source
|
||||
# directory, we can enforce the convention that only
|
||||
# generated files be specified with their full name.
|
||||
# If this becomes a problem with the third party build
|
||||
# systems at some point in the future, we may have to
|
||||
# exclude src/other paths from this check.
|
||||
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
IS_SUBPATH("${CMAKE_BINARY_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "0")
|
||||
IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "1")
|
||||
message(FATAL_ERROR "${ITEM} is listed in \"${CMAKE_CURRENT_SOURCE_DIR}\" using its absolute path. Please specify the location of this file using a relative path.")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "1")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "0")
|
||||
endif(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
# Ignore files specified using full paths, since they
|
||||
# should be generated files and are not part of the
|
||||
# source code repository.
|
||||
get_filename_component(ITEM_ABS_PATH "${ITEM_PATH}" ABSOLUTE)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
message(FATAL_ERROR "Attempting to ignore non-existent file ${ITEM}, in directory \"${CMAKE_CURRENT_SOURCE_DIR}\"")
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
# Append files and directories to their respective lists.
|
||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_DIRS "${ITEM_ABS_PATH}/${ITEM_NAME}")
|
||||
else(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}/${ITEM_NAME}")
|
||||
endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}")
|
||||
# Add the parent directories of the specified file or directory as well -
|
||||
# the convention is that once at least one file or directory in a path is recorded
|
||||
# by the build logic, the parent directories along that path have also been recorded.
|
||||
while(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
get_filename_component(ITEM_NAME "${ITEM_PATH}" NAME)
|
||||
get_filename_component(ITEM_PATH "${ITEM_PATH}" PATH)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
get_filename_component(ITEM_ABS_PATH "${ITEM_PATH}" ABSOLUTE)
|
||||
if(NOT "${ITEM_NAME}" STREQUAL "..")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}")
|
||||
endif(NOT "${ITEM_NAME}" STREQUAL "..")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endwhile(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
else(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
# The easy case - no path specified, so assume the current source directory.
|
||||
# Handled target flags, proceeding with tests.
|
||||
if(CMAKEFILES_DO_TEST)
|
||||
get_filename_component(ITEM_PATH "${ITEM}" PATH)
|
||||
get_filename_component(ITEM_NAME "${ITEM}" NAME)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
# If the build directory is not the same as the source
|
||||
# directory, we can enforce the convention that only
|
||||
# generated files be specified with their full name.
|
||||
# If this becomes a problem with the third party build
|
||||
# systems at some point in the future, we may have to
|
||||
# exclude src/other paths from this check.
|
||||
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
IS_SUBPATH("${CMAKE_BINARY_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "0")
|
||||
IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "1")
|
||||
message(FATAL_ERROR "${ITEM} is listed in \"${CMAKE_CURRENT_SOURCE_DIR}\" using its absolute path. Please specify the location of this file using a relative path.")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "1")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "0")
|
||||
endif(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||
# Ignore files specified using full paths, since they
|
||||
# should be generated files and are not part of the
|
||||
# source code repository.
|
||||
get_filename_component(ITEM_ABS_PATH "${ITEM_PATH}" ABSOLUTE)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
message(FATAL_ERROR "Attempting to ignore non-existent file ${ITEM}, in directory \"${CMAKE_CURRENT_SOURCE_DIR}\"")
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
# Append files and directories to their respective lists.
|
||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM_NAME}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_DIRS "${ITEM_ABS_PATH}/${ITEM_NAME}")
|
||||
else(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM_NAME}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}/${ITEM_NAME}")
|
||||
endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endif(CMAKEFILES_DO_TEST)
|
||||
endforeach(ITEM ${ARGN})
|
||||
endif(NOT BRLCAD_IS_SUBBUILD)
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}")
|
||||
# Add the parent directories of the specified file or directory as well -
|
||||
# the convention is that once at least one file or directory in a path is recorded
|
||||
# by the build logic, the parent directories along that path have also been recorded.
|
||||
while(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
get_filename_component(ITEM_NAME "${ITEM_PATH}" NAME)
|
||||
get_filename_component(ITEM_PATH "${ITEM_PATH}" PATH)
|
||||
if(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
get_filename_component(ITEM_ABS_PATH "${ITEM_PATH}" ABSOLUTE)
|
||||
if(NOT "${ITEM_NAME}" STREQUAL "..")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${ITEM_ABS_PATH}")
|
||||
endif(NOT "${ITEM_NAME}" STREQUAL "..")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endwhile(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "${ITEM_ABS_PATH}")
|
||||
else(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
# The easy case - no path specified, so assume the current source directory.
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
message(FATAL_ERROR "Attempting to ignore non-existent file ${ITEM}, in directory \"${CMAKE_CURRENT_SOURCE_DIR}\"")
|
||||
endif(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM_NAME}")
|
||||
else(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM_NAME}")
|
||||
endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${ITEM}")
|
||||
endif(NOT "${ITEM_PATH}" STREQUAL "")
|
||||
endif(CMAKEFILES_DO_TEST)
|
||||
endforeach(ITEM ${ARGN})
|
||||
endmacro(CMAKEFILES FILESLIST)
|
||||
|
||||
# Routine to tell distcheck to ignore a series of items in a directory. Items may themselves
|
||||
# be directories. Primarily useful when working with src/other dist lists.
|
||||
# be directories.
|
||||
macro(CMAKEFILES_IN_DIR filestoignore targetdir)
|
||||
if(NOT BRLCAD_IS_SUBBUILD)
|
||||
set(CMAKE_IGNORE_LIST "")
|
||||
foreach(filepath ${${filestoignore}})
|
||||
set(CMAKE_IGNORE_LIST ${CMAKE_IGNORE_LIST} "${targetdir}/${filepath}")
|
||||
endforeach(filepath ${filestoignore})
|
||||
CMAKEFILES(${CMAKE_IGNORE_LIST})
|
||||
endif(NOT BRLCAD_IS_SUBBUILD)
|
||||
set(CMAKE_IGNORE_LIST "")
|
||||
foreach(filepath ${${filestoignore}})
|
||||
set(CMAKE_IGNORE_LIST ${CMAKE_IGNORE_LIST} "${targetdir}/${filepath}")
|
||||
endforeach(filepath ${filestoignore})
|
||||
CMAKEFILES(${CMAKE_IGNORE_LIST})
|
||||
endmacro(CMAKEFILES_IN_DIR)
|
||||
|
||||
# Local Variables:
|
||||
|
||||
@@ -50,7 +50,7 @@ CHECK_CXX_FLAG(fstrength-reduce GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG(finline-functions GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
CHECK_CXX_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
if(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
if(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
|
||||
CHECK_C_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_CXX_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
@@ -58,20 +58,20 @@ if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
CHECK_C_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
|
||||
CHECK_CXX_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
|
||||
endif(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
|
||||
if(${BRLCAD_FLAGS_OPTIMIZATION} MATCHES "AUTO")
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
set(opt_conf_list "Release")
|
||||
else(CMAKE_CONFIGURATION_TYPES)
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
if(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
set(opt_conf_list "ALL")
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
endif(CMAKE_CONFIGURATION_TYPES)
|
||||
else(${BRLCAD_FLAGS_OPTIMIZATION} MATCHES "AUTO")
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
if(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
set(opt_conf_list "ALL")
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "ON")
|
||||
endif(${BRLCAD_FLAGS_OPTIMIZATION} MATCHES "AUTO")
|
||||
if(opt_conf_list)
|
||||
ADD_NEW_FLAG(C OPTIMIZE_C_FLAGS "${opt_conf_list}")
|
||||
@@ -82,29 +82,29 @@ endif(opt_conf_list)
|
||||
# intended to help make it easier to identify problematic code but
|
||||
# only when compiling unoptimized (because the extra barrier checks
|
||||
# can affect the memory footprint and runtime performance.
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
if(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
CHECK_C_FLAG(fstack-protector-all)
|
||||
CHECK_CXX_FLAG(fstack-protector-all)
|
||||
# checking both in case compiling c/c++ with different compilers
|
||||
CHECK_C_FLAG(qstackprotect)
|
||||
CHECK_CXX_FLAG(qstackprotect)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG)
|
||||
|
||||
# enable memory error detector AddressSanitizer (see
|
||||
# https://code.google.com/p/address-sanitizer/ for more info.)
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_ADDRESS_SANITIZER)
|
||||
if(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_ADDRESS_SANITIZER)
|
||||
CHECK_C_FLAG(fsanitize=address)
|
||||
CHECK_C_FLAG(fno-omit-frame-pointer)
|
||||
CHECK_CXX_FLAG(fsanitize=address)
|
||||
CHECK_CXX_FLAG(fno-omit-frame-pointer)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_ADDRESS_SANITIZER)
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_ADDRESS_SANITIZER)
|
||||
|
||||
# enable data race detector ThreadSanitizer (see
|
||||
# https://code.google.com/p/thread-sanitizer/ for more info.)
|
||||
if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_THREAD_SANITIZER)
|
||||
if(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_THREAD_SANITIZER)
|
||||
CHECK_C_FLAG(fsanitize=thread)
|
||||
CHECK_CXX_FLAG(fsanitize=thread)
|
||||
endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_THREAD_SANITIZER)
|
||||
endif(${OPTIMIZED_BUILD} MATCHES "OFF" AND BRLCAD_FLAGS_DEBUG AND BRLCAD_THREAD_SANITIZER)
|
||||
|
||||
|
||||
# verbose warning flags. we intentionally try to turn on as many as
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
# We will need a brlcad_config.h.in file to hold all the #cmakedefine
|
||||
# statements, which will in turn be used to generate a brlcad_conf.h
|
||||
# file. In autotools this process is handled by autoheader - in the
|
||||
# case of CMake we wrap the CHECK_* functions and the creation of the
|
||||
# entry in the brlcad_config.h.in file into one step via a macro.
|
||||
#
|
||||
# To avoid hitting the disk I/O any harder than necessary, we store
|
||||
# the eventual contents of brlcad_config.h.in as a CMake string until
|
||||
# it is ready to process. A global property is needed to hold the
|
||||
# contents, because subdirectories (in particular, src/other) may
|
||||
# have content to contribute to the top level config.h.in file and
|
||||
# the default local variable scope in subdirectories means those
|
||||
# changes would not automatically propagate back up.
|
||||
#
|
||||
# We also allow for multiple projects with this macro, in case
|
||||
# subprojects are also managing a config.h.in a file of their own.
|
||||
|
||||
set(CONFIG_H_FILE "${BRLCAD_BINARY_DIR}/include/brlcad_config.h.in")
|
||||
set_source_files_properties(${CONFIG_H_FILE} PROPERTIES GENERATED TRUE)
|
||||
|
||||
set(CMAKE_CURRENT_PROJECT BRLCAD)
|
||||
|
||||
define_property(GLOBAL PROPERTY BRLCAD_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for BRL-CAD project")
|
||||
if(NOT COMMAND CONFIG_H_APPEND)
|
||||
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
|
||||
if(PROJECT_NAME)
|
||||
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
|
||||
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
|
||||
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
|
||||
endif(PROJECT_NAME)
|
||||
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
|
||||
endif(NOT COMMAND CONFIG_H_APPEND)
|
||||
|
||||
CONFIG_H_APPEND(BRLCAD "/**** Define statements for CMake ****/\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#ifndef __CONFIG_H__\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define __CONFIG_H__\n")
|
||||
|
||||
# Set up some of the define statements for path information and other basics
|
||||
CONFIG_H_APPEND(BRLCAD "#define PACKAGE \"brlcad\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define PACKAGE_BUGREPORT \"http://brlcad.org\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define PACKAGE_NAME \"BRL-CAD\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define PACKAGE_STRING \"BRL-CAD ${BRLCAD_VERSION}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define PACKAGE_TARNAME \"brlcad\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DATA \"${CMAKE_INSTALL_PREFIX}/${DATA_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_ROOT \"${CMAKE_INSTALL_PREFIX}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_BIN_DIR \"${BIN_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_LIB_DIR \"${LIB_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_INCLUDE_DIR \"${INCLUDE_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DATA_DIR \"${DATA_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DOC_DIR \"${DOC_DIR}\"\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_MAN_DIR \"${MAN_DIR}\"\n")
|
||||
|
||||
# Write out our version information
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_VERSION_MAJOR ${BRLCAD_VERSION_MAJOR}\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_VERSION_MINOR ${BRLCAD_VERSION_MINOR}\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define BRLCAD_VERSION_PATCH ${BRLCAD_VERSION_PATCH}\n")
|
||||
|
||||
# Let programs know what the executable suffix is on this platform, if any
|
||||
CONFIG_H_APPEND(BRLCAD "#define EXECUTABLE_SUFFIX \"${CMAKE_EXECUTABLE_SUFFIX}\"\n")
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# The location in which to install BRL-CAD. Only do this if
|
||||
# CMAKE_INSTALL_PREFIX hasn't been set already.
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
|
||||
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/brlcad/rel-${BRLCAD_VERSION}")
|
||||
else("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
else(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if(MSVC)
|
||||
if(CMAKE_CL_64)
|
||||
set(CMAKE_INSTALL_PREFIX "C:/Program Files/BRL-CAD ${BRLCAD_VERSION}")
|
||||
else(CMAKE_CL_64)
|
||||
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/BRL-CAD ${BRLCAD_VERSION}")
|
||||
endif(CMAKE_CL_64)
|
||||
else(MSVC)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
endif(MSVC)
|
||||
endif(NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "BRL-CAD install prefix" FORCE)
|
||||
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
|
||||
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
|
||||
set(BRLCAD_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE STRING "BRL-CAD install prefix")
|
||||
mark_as_advanced(BRLCAD_PREFIX)
|
||||
|
||||
# If we've a Release build with a Debug path or vice versa, warn about
|
||||
# it. A "make install" of a Release build into a dev install
|
||||
# directory or vice versa is going to result in an install that
|
||||
# doesn't respect BRL-CAD standard naming conventions.
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
message(FATAL_ERROR "\nInstallation directory (CMAKE_INSTALL_PREFIX) is set to /usr/brlcad/dev-${BRLCAD_VERSION}, but build type is set to Release!\n")
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/brlcad/dev-${BRLCAD_VERSION}")
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/brlcad/rel-${BRLCAD_VERSION}")
|
||||
message(FATAL_ERROR "\nInstallation directory (CMAKE_INSTALL_PREFIX) is set to /usr/brlcad/rel-${BRLCAD_VERSION}, but build type is set to Debug!\n")
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/brlcad/rel-${BRLCAD_VERSION}")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
+416
-49
@@ -33,55 +33,6 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
###
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build Type aware option
|
||||
macro(AUTO_OPTION username varname debug_state release_state)
|
||||
string(LENGTH "${${username}}" ${username}_SET)
|
||||
|
||||
if(NOT ${username}_SET)
|
||||
set(${username} "AUTO" CACHE STRING "auto option" FORCE)
|
||||
endif(NOT ${username}_SET)
|
||||
|
||||
set_property(CACHE ${username} PROPERTY STRINGS AUTO "ON" "OFF")
|
||||
|
||||
string(TOUPPER "${${username}}" username_upper)
|
||||
set(${username} ${username_upper})
|
||||
|
||||
if(NOT ${${username}} MATCHES "AUTO" AND NOT ${${username}} MATCHES "ON" AND NOT ${${username}} MATCHES "OFF")
|
||||
message(WARNING "Unknown value ${${username}} supplied for ${username} - defaulting to AUTO.\nValid options are AUTO, ON and OFF")
|
||||
set(${username} "AUTO" CACHE STRING "auto option" FORCE)
|
||||
endif(NOT ${${username}} MATCHES "AUTO" AND NOT ${${username}} MATCHES "ON" AND NOT ${${username}} MATCHES "OFF")
|
||||
|
||||
# If the "parent" setting isn't AUTO, do what it says
|
||||
if(NOT ${${username}} MATCHES "AUTO")
|
||||
set(${varname} ${${username}})
|
||||
endif(NOT ${${username}} MATCHES "AUTO")
|
||||
|
||||
# If we don't understand the build type and have an AUTO setting,
|
||||
# varname is not set.
|
||||
if(CMAKE_BUILD_TYPE AND NOT "${CMAKE_BUILD_TYPE}" MATCHES "Release" AND NOT "${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
if(NOT ${${username}} MATCHES "AUTO")
|
||||
set(${varname} ${${username}})
|
||||
endif(NOT ${${username}} MATCHES "AUTO")
|
||||
endif(CMAKE_BUILD_TYPE AND NOT "${CMAKE_BUILD_TYPE}" MATCHES "Release" AND NOT "${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
|
||||
# If we DO understand the build type and have AUTO, be smart
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND ${${username}} MATCHES "AUTO")
|
||||
set(${varname} ${release_state})
|
||||
set(${username} "${release_state} (AUTO)" CACHE STRING "auto option" FORCE)
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Release" AND ${${username}} MATCHES "AUTO")
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND ${${username}} MATCHES "AUTO")
|
||||
set(${varname} ${debug_state})
|
||||
set(${username} "${debug_state} (AUTO)" CACHE STRING "auto option" FORCE)
|
||||
endif("${CMAKE_BUILD_TYPE}" MATCHES "Debug" AND ${${username}} MATCHES "AUTO")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND ${${username}} MATCHES "AUTO")
|
||||
set(${varname} ${debug_state})
|
||||
set(${username} "${debug_state} (AUTO)" CACHE STRING "auto option" FORCE)
|
||||
endif(NOT CMAKE_BUILD_TYPE AND ${${username}} MATCHES "AUTO")
|
||||
|
||||
endmacro(AUTO_OPTION varname release_state debug_state)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# For "top-level" BRL-CAD options, some extra work is in order - descriptions and
|
||||
@@ -201,6 +152,422 @@ macro(BRLCAD_OPTION default opt opt_ALIASES opt_DESCRIPTION)
|
||||
OPTION_DESCRIPTION("${opt}" "${opt_ALIASES}" "${opt_DESCRIPTION}")
|
||||
endmacro(BRLCAD_OPTION)
|
||||
|
||||
|
||||
# Now we define the various options for BRL-CAD - ways to enable and
|
||||
# disable features, select which parts of the system to build, etc.
|
||||
# As much as possible, sane default options are either selected or
|
||||
# detected. Because documentation is autogenerated for BRL-CAD
|
||||
# options, be sure to initialize the file.
|
||||
set(CONFIG_OPT_STRING "CONFIGURATION OPTIONS\n---------------------\n")
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/OPTIONS" "${CONFIG_OPT_STRING}")
|
||||
|
||||
# The BRL-CAD CMake options system will also generate a configure script that
|
||||
# emulates the command option style of GNU Autotool's configure. Write the
|
||||
# pre-defined header into the build-dir template to initialize the file.
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/configure.new")
|
||||
file(READ "${CMAKE_SOURCE_DIR}/misc/CMake/configure_prefix.sh" CONFIG_PREFIX)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/configure.new.tmp" "${CONFIG_PREFIX}")
|
||||
file(COPY "${CMAKE_BINARY_DIR}/configure.new.tmp" DESTINATION
|
||||
"${CMAKE_BINARY_DIR}/CMakeFiles" FILE_PERMISSIONS OWNER_READ OWNER_WRITE
|
||||
OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/configure.new.tmp")
|
||||
file(RENAME "${CMAKE_BINARY_DIR}/CMakeFiles/configure.new.tmp" "${CMAKE_BINARY_DIR}/configure.new")
|
||||
|
||||
# Turn off the brlcad.dll build.
|
||||
# It's an expert's setting at the moment.
|
||||
option(BRLCAD_ENABLE_BRLCAD_LIBRARY "Build the brlcad.dll" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_BRLCAD_LIBRARY)
|
||||
|
||||
# Enable Aqua widgets on Mac OSX. This impacts Tcl/Tk building and OpenGL
|
||||
# building. Not currently working - needs work in at least Tk
|
||||
# CMake logic (probably more), and the display manager/framebuffer codes are known to depend
|
||||
# on either GLX or WGL specifically in their current forms.
|
||||
option(BRLCAD_ENABLE_AQUA "Use Aqua instead of X11 whenever possible on OSX." OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_AQUA)
|
||||
if(BRLCAD_ENABLE_AQUA)
|
||||
set(DISABLE_X11 1)
|
||||
endif(BRLCAD_ENABLE_AQUA)
|
||||
|
||||
# test for X11 on all platforms since we don't know when/where we'll find it, unless
|
||||
# we've indicated we *don't* want an X11 build
|
||||
if(NOT DISABLE_X11)
|
||||
include("${CMAKE_SOURCE_DIR}/misc/CMake/FindX11.cmake")
|
||||
endif(NOT DISABLE_X11)
|
||||
|
||||
# Set whether X11 is enabled or disabled by default
|
||||
if(WIN32)
|
||||
# even if there is x11, we default to native
|
||||
option(BRLCAD_ENABLE_X11 "Use X11." OFF)
|
||||
elseif(BRLCAD_ENABLE_AQUA)
|
||||
# aqua implies no X11
|
||||
option(BRLCAD_ENABLE_X11 "Use X11." OFF)
|
||||
else(WIN32)
|
||||
# make everywhere else depend on whether we found a suitable X11
|
||||
if(X11_X11_LIB AND X11_Xext_LIB AND X11_Xi_LIB AND X11_Xlib_INCLUDE_PATH)
|
||||
option(BRLCAD_ENABLE_X11 "Use X11." ON)
|
||||
else(X11_X11_LIB AND X11_Xext_LIB AND X11_Xi_LIB AND X11_Xlib_INCLUDE_PATH)
|
||||
option(BRLCAD_ENABLE_X11 "Use X11." OFF)
|
||||
endif(X11_X11_LIB AND X11_Xext_LIB AND X11_Xi_LIB AND X11_Xlib_INCLUDE_PATH)
|
||||
endif(WIN32)
|
||||
mark_as_advanced(BRLCAD_ENABLE_X11)
|
||||
|
||||
# if X11 is enabled, make sure aqua is off
|
||||
if(BRLCAD_ENABLE_X11)
|
||||
set(BRLCAD_ENABLE_AQUA OFF CACHE STRING "Don't use Aqua if we're doing X11" FORCE)
|
||||
set(OPENGL_USE_AQUA OFF CACHE STRING "Don't use Aqua if we're doing X11" FORCE)
|
||||
endif(BRLCAD_ENABLE_X11)
|
||||
mark_as_advanced(OPENGL_USE_AQUA)
|
||||
|
||||
# Install example BRL-CAD Geometry Files
|
||||
option(BRLCAD_INSTALL_EXAMPLE_GEOMETRY "Install the example BRL-CAD geometry files." ON)
|
||||
|
||||
|
||||
# Enable/disable features requiring the Tk toolkit - usually this should
|
||||
# be on, as a lot of functionality in BRL-CAD depends on Tk
|
||||
option(BRLCAD_ENABLE_TK "Enable features requiring the Tk toolkit" ON)
|
||||
mark_as_advanced(BRLCAD_ENABLE_TK)
|
||||
if(NOT BRLCAD_ENABLE_X11 AND NOT BRLCAD_ENABLE_AQUA AND NOT WIN32)
|
||||
set(BRLCAD_ENABLE_TK OFF)
|
||||
endif(NOT BRLCAD_ENABLE_X11 AND NOT BRLCAD_ENABLE_AQUA AND NOT WIN32)
|
||||
if(BRLCAD_ENABLE_X11)
|
||||
set(TK_X11_GRAPHICS ON CACHE STRING "Need X11 Tk" FORCE)
|
||||
endif(BRLCAD_ENABLE_X11)
|
||||
|
||||
# Enable features requiring OPENGL
|
||||
# Be smart about this - if we don't have X11 or Aqua and we're
|
||||
# not on Windows, we're non-graphical and that means OpenGL is
|
||||
# a no-go. The Windows version would have to be some sort of
|
||||
# option for the WIN32 graphics layer? Should probably think
|
||||
# about that... for now, on Win32 don't try OpenGL if Tk is
|
||||
# off. That'll hold until we get a non-Tk based GUI - then
|
||||
# setting non-graphical on Windows will take more thought.
|
||||
if(NOT BRLCAD_ENABLE_X11 AND NOT BRLCAD_ENABLE_AQUA AND NOT WIN32)
|
||||
set(OPENGL_FOUND OFF)
|
||||
set(BRLCAD_ENABLE_OPENGL OFF CACHE BOOL "Disabled - NOT BRLCAD_ENABLE_X11 and NOT BRLCAD_ENABLE_AQUA" FORCE)
|
||||
else(NOT BRLCAD_ENABLE_X11 AND NOT BRLCAD_ENABLE_AQUA AND NOT WIN32)
|
||||
include("${CMAKE_SOURCE_DIR}/misc/CMake/FindGL.cmake")
|
||||
endif(NOT BRLCAD_ENABLE_X11 AND NOT BRLCAD_ENABLE_AQUA AND NOT WIN32)
|
||||
|
||||
set(BRLCAD_ENABLE_OPENGL_ALIASES
|
||||
ENABLE_OPENGL
|
||||
)
|
||||
set(BRLCAD_ENABLE_OPENGL_DESCRIPTION "
|
||||
Enable support for OpenGL based Display Managers in BRL-CAD.
|
||||
Default depends on whether OpenGL is successfully detected -
|
||||
if it is, default is to enable.
|
||||
")
|
||||
BRLCAD_OPTION(${OPENGL_FOUND} BRLCAD_ENABLE_OPENGL BRLCAD_ENABLE_OPENGL_ALIASES BRLCAD_ENABLE_OPENGL_DESCRIPTION)
|
||||
|
||||
# Enable RTGL. Requires an enabled OpenGL.
|
||||
option(BRLCAD_ENABLE_RTGL "Enable experimental RTGL code." OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_RTGL)
|
||||
if(NOT BRLCAD_ENABLE_OPENGL AND BRLCAD_ENABLE_RTGL)
|
||||
message("RTGL requested, but OpenGL is not enabled - disabling")
|
||||
set(BRLCAD_ENABLE_RTGL OFF CACHE BOOL "Enable experimental RTGL code." FORCE)
|
||||
endif(NOT BRLCAD_ENABLE_OPENGL AND BRLCAD_ENABLE_RTGL)
|
||||
if(NOT BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_RTGL)
|
||||
message("RTGL currently works only with GLX, and X11 is not enabled - disabling")
|
||||
set(BRLCAD_ENABLE_RTGL OFF CACHE BOOL "Enable experimental RTGL code." FORCE)
|
||||
endif(NOT BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_RTGL)
|
||||
if(BRLCAD_ENABLE_AQUA)
|
||||
set(OPENGL_USE_AQUA ON CACHE STRING "Aqua enabled - use Aqua OpenGL" FORCE)
|
||||
endif(BRLCAD_ENABLE_AQUA)
|
||||
|
||||
# Enable features requiring Qt
|
||||
find_package(Qt5Widgets QUIET)
|
||||
option(BRLCAD_ENABLE_QT "Enable features requiring Qt" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_QT)
|
||||
mark_as_advanced(Qt5Core_DIR)
|
||||
mark_as_advanced(Qt5Gui_DIR)
|
||||
if(NOT Qt5Widgets_FOUND AND BRLCAD_ENABLE_QT)
|
||||
message("QT interface requested, but QT5 is not found - disabling")
|
||||
set(BRLCAD_ENABLE_QT OFF)
|
||||
endif(NOT Qt5Widgets_FOUND AND BRLCAD_ENABLE_QT)
|
||||
mark_as_advanced(Qt5Widgets_DIR)
|
||||
|
||||
# Enable features requiring OpenSceneGraph
|
||||
option(BRLCAD_ENABLE_OSG "Enable features requiring OpenSceneGraph" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_OSG)
|
||||
if(BRLCAD_ENABLE_OSG)
|
||||
if(APPLE AND NOT BRLCAD_ENABLE_AQUA)
|
||||
set(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Use X11" FORCE)
|
||||
endif(APPLE AND NOT BRLCAD_ENABLE_AQUA)
|
||||
endif(BRLCAD_ENABLE_OSG)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# The following are fine-grained options for enabling/disabling compiler
|
||||
# and source code definition settings. Typically these are set to
|
||||
# various configurations by the toplevel CMAKE_BUILD_TYPE setting, but
|
||||
# can also be individually set.
|
||||
|
||||
# Enable/disable runtime debugging - these are protections for
|
||||
# minimizing the possibility of corrupted data files. Generally
|
||||
# speaking these should be left on.
|
||||
set(BRLCAD_ENABLE_RUNTIME_DEBUG_ALIASES
|
||||
ENABLE_RUNTIME_DEBUG
|
||||
ENABLE_RUN_TIME_DEBUG
|
||||
ENABLE_RUNTIME_DEBUGGING
|
||||
ENABLE_RUN_TIME_DEBUGGING)
|
||||
set(BRLCAD_ENABLE_RUNTIME_DEBUG_DESCRIPTION "
|
||||
Enables support for application and library debugging facilities.
|
||||
Disabling the run-time debugging facilities can provide a significant
|
||||
(10%-30%) performance boost at the expense of extensive error
|
||||
checking (that in turn help prevent corruption of your data).
|
||||
Default is \"ON\", and should only be disabled for read-only render
|
||||
work where performance is critical.
|
||||
")
|
||||
BRLCAD_OPTION(ON BRLCAD_ENABLE_RUNTIME_DEBUG BRLCAD_ENABLE_RUNTIME_DEBUG_ALIASES BRLCAD_ENABLE_RUNTIME_DEBUG_DESCRIPTION)
|
||||
mark_as_advanced(BRLCAD_ENABLE_RUNTIME_DEBUG)
|
||||
if(NOT BRLCAD_ENABLE_RUNTIME_DEBUG)
|
||||
message("}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}")
|
||||
message("While disabling run-time debugging should increase")
|
||||
message("performance, it will likewise remove several")
|
||||
message("data-protection safeguards that are in place to")
|
||||
message("minimize the possibility of corrupted data files")
|
||||
message("in the inevitable event of a user encountering a bug.")
|
||||
message("You have been warned. Proceed at your own risk.")
|
||||
message("{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{")
|
||||
CONFIG_H_APPEND(BRLCAD "/*Define to not do anything for macros that only bomb on a fatal error. */\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define NO_BOMBING_MACROS 1\n")
|
||||
CONFIG_H_APPEND(BRLCAD "/*Define to not perform magic number checking */\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define NO_MAGIC_CHECKING 1\n")
|
||||
CONFIG_H_APPEND(BRLCAD "/*Define to not provide run-time debug facilities via RTG.debug */\n")
|
||||
CONFIG_H_APPEND(BRLCAD "#define NO_DEBUG_CHECKING 1\n")
|
||||
endif(NOT BRLCAD_ENABLE_RUNTIME_DEBUG)
|
||||
|
||||
# Enable debug flags during compilation - we always want to use these
|
||||
# unless explicitly told not to.
|
||||
set(BRLCAD_FLAGS_DEBUG_ALIASES
|
||||
ENABLE_DEBUG
|
||||
ENABLE_FLAGS_DEBUG
|
||||
ENABLE_DEBUG_FLAGS
|
||||
)
|
||||
set(BRLCAD_FLAGS_DEBUG_DESCRIPTION "
|
||||
Add compiler flags to aid in program debugging. Defaults to ON.
|
||||
")
|
||||
BRLCAD_OPTION(ON BRLCAD_FLAGS_DEBUG BRLCAD_FLAGS_DEBUG_ALIASES BRLCAD_FLAGS_DEBUG_DESCRIPTION)
|
||||
|
||||
# A variety of debugging messages in the code key off of the DEBUG
|
||||
# definition - set it according to whether we're using debug flags.
|
||||
if(BRLCAD_FLAGS_DEBUG)
|
||||
CONFIG_H_APPEND(BRLCAD "#define DEBUG 1\n")
|
||||
endif(BRLCAD_FLAGS_DEBUG)
|
||||
|
||||
# Build with compiler warning flags
|
||||
set(BRLCAD_ENABLE_COMPILER_WARNINGS_ALIASES
|
||||
ENABLE_WARNINGS
|
||||
ENABLE_COMPILER_WARNINGS
|
||||
)
|
||||
set(BRLCAD_ENABLE_COMPILER_WARNINGS_DESCRIPTION "
|
||||
Use extra compiler warning flags when compiling C/C++ code. Defaults to ON.
|
||||
")
|
||||
BRLCAD_OPTION(ON BRLCAD_ENABLE_COMPILER_WARNINGS
|
||||
BRLCAD_ENABLE_COMPILER_WARNINGS_ALIASES
|
||||
BRLCAD_ENABLE_COMPILER_WARNINGS_DESCRIPTION)
|
||||
mark_as_advanced(BRLCAD_ENABLE_COMPILER_WARNINGS)
|
||||
|
||||
# Enable/disable strict compiler settings - these are used for building
|
||||
# BRL-CAD by default, but not src/other code. Always used for BRL-CAD
|
||||
# code unless the NO_STRICT option is specified when defining a target
|
||||
# with BRLCAD_ADDEXEC or BRLCAD_ADDLIB. If only C++ files in a target
|
||||
# are not compatible with strict, the NO_STRICT_CXX option can be used.
|
||||
set(BRLCAD_ENABLE_STRICT_ALIASES
|
||||
ENABLE_STRICT
|
||||
ENABLE_STRICT_COMPILE
|
||||
ENABLE_STRICT_COMPILE_FLAGS)
|
||||
set(BRLCAD_ENABLE_STRICT_DESCRIPTION "
|
||||
Causes all compilation warnings for C code to be treated as errors. This is now
|
||||
the default for BRL-CAD source code, and developers should address issues
|
||||
discovered by these flags whenever possible rather than disabling strict
|
||||
mode.
|
||||
")
|
||||
BRLCAD_OPTION(ON BRLCAD_ENABLE_STRICT BRLCAD_ENABLE_STRICT_ALIASES BRLCAD_ENABLE_STRICT_DESCRIPTION)
|
||||
if(BRLCAD_ENABLE_STRICT)
|
||||
mark_as_advanced(BRLCAD_ENABLE_STRICT)
|
||||
CONFIG_H_APPEND(BRLCAD "#define STRICT_FLAGS 1\n")
|
||||
endif(BRLCAD_ENABLE_STRICT)
|
||||
|
||||
|
||||
# Build with full compiler lines visible by default (won't need make
|
||||
# VERBOSE=1) on command line
|
||||
option(BRLCAD_ENABLE_VERBOSE_PROGRESS "verbose output" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_VERBOSE_PROGRESS)
|
||||
if(BRLCAD_ENABLE_VERBOSE_PROGRESS)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
endif(BRLCAD_ENABLE_VERBOSE_PROGRESS)
|
||||
|
||||
# Build with profiling support
|
||||
option(BRLCAD_ENABLE_PROFILING "Build with profiling support" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_PROFILING)
|
||||
|
||||
#====== ALL CXX COMPILE ===================
|
||||
# Build all C and C++ files with a C++ compiler
|
||||
set(ENABLE_ALL_CXX_COMPILE_ALIASES "ENABLE_ALL_CXX")
|
||||
set(ENABLE_ALL_CXX_COMPILE_DESCRIPTION "
|
||||
Build all C and C++ files with a C++ compiler. Defaults to OFF.
|
||||
|
||||
EXPERIMENTAL!
|
||||
")
|
||||
BRLCAD_OPTION(OFF ENABLE_ALL_CXX_COMPILE
|
||||
ENABLE_ALL_CXX_COMPILE_ALIASES
|
||||
ENABLE_ALL_CXX_COMPILE_DESCRIPTION)
|
||||
mark_as_advanced(ENABLE_ALL_CXX_COMPILE)
|
||||
|
||||
# Build with coverage enabled
|
||||
option(BRLCAD_ENABLE_COVERAGE "Build with coverage enabled" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_COVERAGE)
|
||||
|
||||
#====== POSIX ===================
|
||||
# Build with strict POSIX compliance checking
|
||||
set(ENABLE_POSIX_COMPLIANCE_ALIASES "ENABLE_POSIX")
|
||||
set(ENABLE_POSIX_COMPLIANCE_DESCRIPTION "
|
||||
Build with strict POSIX compliance checking. Defaults to OFF.
|
||||
|
||||
Causes compiler options to be set for strict compliance with the
|
||||
minimum C and C++ standards acceptable according to current BRL-CAD
|
||||
policy. The current minimum C standard is ??.
|
||||
There is no currently defined minimum C++ standard.
|
||||
")
|
||||
BRLCAD_OPTION(OFF ENABLE_POSIX_COMPLIANCE
|
||||
ENABLE_POSIX_COMPLIANCE_ALIASES
|
||||
ENABLE_POSIX_COMPLIANCE_DESCRIPTION)
|
||||
mark_as_advanced(ENABLE_POSIX_COMPLIANCE)
|
||||
|
||||
#== ISO C ==
|
||||
set(ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE_ALIASES "STRICT_ISO_C")
|
||||
set(ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE_DESCRIPTION "
|
||||
Build with strict ISO C compliance checking. Defaults to OFF.
|
||||
|
||||
Causes C compiler options to be set for strict compliance with the
|
||||
appropriate ISO C standard.
|
||||
")
|
||||
BRLCAD_OPTION(OFF ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE
|
||||
ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE_ALIASES
|
||||
ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE_DESCRIPTION)
|
||||
mark_as_advanced(ENABLE_STRICT_COMPILER_STANDARD_COMPLIANCE)
|
||||
|
||||
# Build with dtrace support
|
||||
option(BRLCAD_ENABLE_DTRACE "Build with dtrace support" OFF)
|
||||
mark_as_advanced(BRLCAD_ENABLE_DTRACE)
|
||||
if(BRLCAD_ENABLE_DTRACE)
|
||||
BRLCAD_INCLUDE_FILE(sys/sdt.h HAVE_SYS_SDT_H)
|
||||
if(NOT HAVE_SYS_SDT_H)
|
||||
set(BRLCAD_ENABLE_DTRACE OFF)
|
||||
endif(NOT HAVE_SYS_SDT_H)
|
||||
endif(BRLCAD_ENABLE_DTRACE)
|
||||
|
||||
|
||||
if(BRLCAD_HEADERS_OLD_COMPAT)
|
||||
add_definitions(-DEXPOSE_FB_HEADER)
|
||||
add_definitions(-DEXPOSE_DM_HEADER)
|
||||
endif(BRLCAD_HEADERS_OLD_COMPAT)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# There are extra documentation files available requiring DocBook
|
||||
# They are quite useful in graphical interfaces, but also add considerably
|
||||
# to the overall build time. If necessary BRL-CAD provides its own
|
||||
# xsltproc (see src/other/xmltools), so the html and man page
|
||||
# outputs are always potentially available. PDF output, on the other hand,
|
||||
# needs Apache FOP. FOP is not a candidate for bundling with BRL-CAD for
|
||||
# a number of reasons, so we simply check to see if it is present and set
|
||||
# the options accordingly.
|
||||
|
||||
# Do we have the environment variable set locally?
|
||||
if(NOT "$ENV{APACHE_FOP}" STREQUAL "")
|
||||
set(APACHE_FOP "$ENV{APACHE_FOP}")
|
||||
endif(NOT "$ENV{APACHE_FOP}" STREQUAL "")
|
||||
if(NOT APACHE_FOP)
|
||||
find_program(APACHE_FOP fop DOC "path to the exec script for Apache FOP")
|
||||
endif(NOT APACHE_FOP)
|
||||
mark_as_advanced(APACHE_FOP)
|
||||
# We care about the FOP version, unfortunately - find out what we have.
|
||||
if(APACHE_FOP)
|
||||
execute_process(COMMAND ${APACHE_FOP} -v OUTPUT_VARIABLE APACHE_FOP_INFO ERROR_QUIET)
|
||||
string(REGEX REPLACE "FOP Version ([0-9\\.]*)" "\\1" APACHE_FOP_VERSION_REGEX "${APACHE_FOP_INFO}")
|
||||
if(APACHE_FOP_VERSION_REGEX)
|
||||
string(STRIP ${APACHE_FOP_VERSION_REGEX} APACHE_FOP_VERSION_REGEX)
|
||||
endif(APACHE_FOP_VERSION_REGEX)
|
||||
if(NOT "${APACHE_FOP_VERSION}" STREQUAL "${APACHE_FOP_VERSION_REGEX}")
|
||||
message("-- Found Apache FOP: version ${APACHE_FOP_VERSION_REGEX}")
|
||||
set(APACHE_FOP_VERSION ${APACHE_FOP_VERSION_REGEX} CACHE STRING "Apache FOP version" FORCE)
|
||||
mark_as_advanced(APACHE_FOP_VERSION)
|
||||
endif(NOT "${APACHE_FOP_VERSION}" STREQUAL "${APACHE_FOP_VERSION_REGEX}")
|
||||
endif(APACHE_FOP)
|
||||
|
||||
# Toplevel variable that controls all DocBook based documentation. Key it off
|
||||
# of what target level is enabled.
|
||||
if(NOT BRLCAD_ENABLE_TARGETS OR "${BRLCAD_ENABLE_TARGETS}" GREATER 2)
|
||||
set(EXTRADOCS_DEFAULT "ON")
|
||||
else(NOT BRLCAD_ENABLE_TARGETS OR "${BRLCAD_ENABLE_TARGETS}" GREATER 2)
|
||||
set(EXTRADOCS_DEFAULT "OFF")
|
||||
endif(NOT BRLCAD_ENABLE_TARGETS OR "${BRLCAD_ENABLE_TARGETS}" GREATER 2)
|
||||
set(BRLCAD_EXTRADOCS_ALIASES
|
||||
ENABLE_DOCS
|
||||
ENABLE_EXTRA_DOCS
|
||||
ENABLE_DOCBOOK
|
||||
)
|
||||
set(BRLCAD_EXTRADOCS_DESCRIPTION "
|
||||
The core option that enables and disables building of BRL-CAD's
|
||||
DocBook based documentation (includes manuals and man pages for
|
||||
commands, among other things). Defaults to ON, but only HTML and MAN
|
||||
formats are enabled by default - PDF must be enabled separately by use
|
||||
of this option or one of its aliases. Note that you may set
|
||||
environment variable APACHE_FOP to point to your locally installed fop
|
||||
executable file (which on Linux is usually a shell script with 0755
|
||||
permissions).
|
||||
")
|
||||
BRLCAD_OPTION(${EXTRADOCS_DEFAULT} BRLCAD_EXTRADOCS BRLCAD_EXTRADOCS_ALIASES BRLCAD_EXTRADOCS_DESCRIPTION)
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
# The HTML output is used in the graphical help browsers in MGED and Archer,
|
||||
# as well as being the most likely candidate for external viewers. Turn this
|
||||
# on unless explicitly instructed otherwise by the user or all extra
|
||||
# documentation is disabled.
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_HTML "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_HTML)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PHP "Build MAN page output from DocBook documentation" OFF "BRLCAD_EXTRADOCS" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_PHP)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PPT "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_PPT)
|
||||
|
||||
# Normally, we'll turn on man page output by default, but there is
|
||||
# no point in doing man page output for a Visual Studio build - the
|
||||
# files aren't useful and it *seriously* increases the target build
|
||||
# count/build time. Conditionalize on the CMake MSVC variable NOT
|
||||
# being set.
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_MAN "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS;NOT MSVC" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_MAN)
|
||||
|
||||
# Don't do PDF by default because it's pretty expensive, and hide the
|
||||
# option unless the tools to do it are present.
|
||||
set(BRLCAD_EXTRADOCS_PDF_DESCRIPTION "
|
||||
Option that enables building of BRL-CAD's DocBook PDF-based documentation
|
||||
(includes manuals and man pages for commands, among
|
||||
other things.) Defaults to OFF.
|
||||
Note that you may set environment variable APACHE_FOP
|
||||
to point to your locally installed fop executable file (which on Linux is
|
||||
usually a shell script with 0755 permissions).
|
||||
")
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PDF "Build PDF output from DocBook documentation" OFF "BRLCAD_EXTRADOCS;APACHE_FOP" OFF)
|
||||
|
||||
# Provide an option to enable/disable XML validation as part
|
||||
# of the DocBook build - sort of a "strict flags" mode for DocBook.
|
||||
# By default, this will be enabled when extra docs are built and
|
||||
# the toplevel BRLCAD_ENABLE_STRICT setting is enabled.
|
||||
# Unfortunately, Visual Studio 2010 seems to have issues when we
|
||||
# enable validation on top of everything else... not clear why,
|
||||
# unless build target counts >1800 are beyond MSVC's practical
|
||||
# limit. Until we either find a resolution or a way to reduce
|
||||
# the target count on MSVC, disable validation there.
|
||||
CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_VALIDATE "Perform validation for DocBook documentation" ON "BRLCAD_EXTRADOCS;BRLCAD_ENABLE_STRICT" OFF)
|
||||
mark_as_advanced(BRLCAD_EXTRADOCS_VALIDATE)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
|
||||
@@ -258,10 +258,10 @@ set(BRLCAD_ENABLE_OPENGL_LABEL "OpenGL support (optional) ")
|
||||
set(BRLCAD_ENABLE_QT_LABEL "Qt support (optional) ")
|
||||
set(BRLCAD_ENABLE_RUNTIME_DEBUG_LABEL "Enable run-time debugging (optional) ")
|
||||
set(BRLCAD_ARCH_BITSETTING_LABEL "Build 32/64-bit release ")
|
||||
set(BRLCAD_OPTIMIZED_BUILD_LABEL "Build optimized release ")
|
||||
set(OPTIMIZED_BUILD_LABEL "Build optimized release ")
|
||||
set(BRLCAD_FLAGS_DEBUG_LABEL "Build debuggable release")
|
||||
set(BRLCAD_ENABLE_PROFILING_LABEL "Build profile release ")
|
||||
set(BRLCAD_ENABLE_SMP_LABEL "Build SMP-capable release ")
|
||||
set(ENABLE_SMP_LABEL "Build SMP-capable release ")
|
||||
set(BUILD_STATIC_LIBS_LABEL "Build static libraries ")
|
||||
set(BUILD_SHARED_LIBS_LABEL "Build dynamic libraries ")
|
||||
set(BRLCAD_ENABLE_COMPILER_WARNINGS_LABEL "Print verbose compilation warnings ")
|
||||
@@ -285,7 +285,7 @@ set(FEATURE_REPORT_ITEMS
|
||||
)
|
||||
|
||||
set(OTHER_REPORT_ITEMS
|
||||
BRLCAD_ARCH_BITSETTING BRLCAD_OPTIMIZED_BUILD
|
||||
BRLCAD_ARCH_BITSETTING OPTIMIZED_BUILD
|
||||
BUILD_STATIC_LIBS BUILD_SHARED_LIBS
|
||||
BRLCAD_INSTALL_EXAMPLE_GEOMETRY BRLCAD_DOCBOOK_BUILD
|
||||
)
|
||||
@@ -293,7 +293,7 @@ set(OTHER_REPORT_ITEMS
|
||||
if(BRLCAD_SUMMARIZE_DEV_SETTINGS)
|
||||
set(OTHER_REPORT_ITEMS ${OTHER_REPORT_ITEMS}
|
||||
BRLCAD_FLAGS_DEBUG
|
||||
BRLCAD_ENABLE_SMP
|
||||
ENABLE_SMP
|
||||
BRLCAD_ENABLE_PROFILING
|
||||
BRLCAD_ENABLE_COMPILER_WARNINGS
|
||||
BRLCAD_ENABLE_VERBOSE_PROGRESS
|
||||
@@ -449,7 +449,7 @@ endif (BRLCAD_EXTRADOCS)
|
||||
|
||||
# In multi-configuration builds, some features are
|
||||
# set at build time instead of configure time.
|
||||
set(MULTICONFIG_FEATURES "BRLCAD_OPTIMIZED_BUILD")
|
||||
set(MULTICONFIG_FEATURES "OPTIMIZED_BUILD")
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
foreach(item ${MULTICONFIG_FEATURES})
|
||||
set(${item} "Build Configuration Dependent")
|
||||
|
||||
@@ -45,7 +45,7 @@ include(CheckCCompilerFlag)
|
||||
macro(GET_TARGET_DEFINES targetname target_libs)
|
||||
# Take care of compile flags and definitions
|
||||
foreach(libitem ${target_libs})
|
||||
list(FIND BRLCAD_LIBS ${libitem} FOUNDIT)
|
||||
list(FIND PROJECT_LIBS ${libitem} FOUNDIT)
|
||||
if(NOT ${FOUNDIT} STREQUAL "-1")
|
||||
get_property(${libitem}_DEFINES GLOBAL PROPERTY ${libitem}_DEFINES)
|
||||
list(APPEND ${targetname}_DEFINES ${${libitem}_DEFINES})
|
||||
@@ -68,7 +68,7 @@ macro(GET_TARGET_DLL_DEFINES targetname target_libs)
|
||||
list(REMOVE_ITEM ${targetname}_DLL_DEFINES ${targetname}_DLL_IMPORTS)
|
||||
endif(${targetname}_DLL_DEFINES)
|
||||
foreach(libitem ${target_libs})
|
||||
list(FIND BRLCAD_LIBS ${libitem} FOUNDIT)
|
||||
list(FIND PROJECT_LIBS ${libitem} FOUNDIT)
|
||||
if(NOT ${FOUNDIT} STREQUAL "-1")
|
||||
get_property(${libitem}_DLL_DEFINES GLOBAL PROPERTY ${libitem}_DLL_DEFINES)
|
||||
list(APPEND ${targetname}_DLL_DEFINES ${${libitem}_DLL_DEFINES})
|
||||
@@ -100,7 +100,7 @@ macro(GET_TARGET_FLAGS targetname target_libs)
|
||||
foreach(lang ${FLAG_LANGUAGES})
|
||||
get_property(${targetname}_${lang}_FLAGS GLOBAL PROPERTY ${targetname}_${lang}_FLAGS)
|
||||
foreach(libitem ${target_libs})
|
||||
list(FIND BRLCAD_LIBS ${libitem} FOUNDIT)
|
||||
list(FIND PROJECT_LIBS ${libitem} FOUNDIT)
|
||||
if(NOT ${FOUNDIT} STREQUAL "-1")
|
||||
get_property(${libitem}_${lang}_FLAGS GLOBAL PROPERTY ${libitem}_${lang}_FLAGS)
|
||||
list(APPEND ${targetname}_${lang}_FLAGS ${${libitem}_${lang}_FLAGS})
|
||||
@@ -156,7 +156,7 @@ endmacro(CXX_NO_STRICT cxx_srcslist)
|
||||
# BRL-CAD style checking test
|
||||
macro(VALIDATE_STYLE srcslist targetname)
|
||||
if(BRLCAD_STYLE_VALIDATE)
|
||||
include("${BRLCAD_SOURCE_DIR}/misc/CMake/style/test_list.cmake")
|
||||
include("${CMAKE_SOURCE_DIR}/misc/CMake/style/test_list.cmake")
|
||||
make_directory("${CMAKE_CURRENT_BINARY_DIR}/validation")
|
||||
|
||||
foreach(test_name ${BRLCAD_STYLE_TESTS})
|
||||
@@ -180,7 +180,7 @@ macro(VALIDATE_STYLE srcslist targetname)
|
||||
set(outfiles_root "${CMAKE_CURRENT_BINARY_DIR}/validation/${root_name}_${path_md5}_${test_name}")
|
||||
set(srcfile_tmp "${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}")
|
||||
set(stampfile_tmp "${stampfile}")
|
||||
configure_file("${BRLCAD_SOURCE_DIR}/misc/CMake/style/${test_name}.cmake.in" ${outfiles_root}.cmake @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/style/${test_name}.cmake.in" ${outfiles_root}.cmake @ONLY)
|
||||
add_custom_command(
|
||||
OUTPUT ${outfiles_root}.checked
|
||||
COMMAND ${CMAKE_COMMAND} -P ${outfiles_root}.cmake
|
||||
@@ -197,7 +197,7 @@ macro(VALIDATE_STYLE srcslist targetname)
|
||||
endforeach(srcfile ${srcslist})
|
||||
|
||||
# Set up build targets that can be used to independently trigger the testing
|
||||
configure_file("${BRLCAD_SOURCE_DIR}/misc/CMake/validate_checkstamp.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${test_name}_${targetname}_validate.cmake" @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/validate_checkstamp.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${test_name}_${targetname}_validate.cmake" @ONLY)
|
||||
add_custom_target(regress-${test_name}-${targetname}
|
||||
${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/${test_name}_${targetname}_validate.cmake"
|
||||
DEPENDS ${test_stamp_files}
|
||||
@@ -210,7 +210,7 @@ macro(VALIDATE_STYLE srcslist targetname)
|
||||
endforeach(test_name ${BRLCAD_STYLE_TESTS})
|
||||
|
||||
# Set up build-integrated validation that is run automatically at compile time.
|
||||
configure_file("${BRLCAD_SOURCE_DIR}/misc/CMake/validate_style.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${targetname}_validate.cmake" @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/validate_style.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${targetname}_validate.cmake" @ONLY)
|
||||
add_custom_command(
|
||||
TARGET ${targetname} PRE_LINK
|
||||
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/${targetname}_validate.cmake"
|
||||
@@ -230,6 +230,8 @@ macro(BRLCAD_ADDEXEC execname srcslist libslist)
|
||||
CMAKE_PARSE_ARGUMENTS(${EXECNAME_UPPER} "NO_INSTALL;NO_STRICT;NO_STRICT_CXX;GUI" "FOLDER" "" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
CMAKEFILES(${srcslist})
|
||||
|
||||
# Go all C++ if the settings request it
|
||||
SET_CXX_LANG("${srcslist}")
|
||||
|
||||
@@ -344,14 +346,15 @@ macro(BRLCAD_ADDLIB libname srcslist libslist)
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
set(all_srcs ${srcslist} ${${LIBNAME_UPPER}_SO_SRCS} ${${LIBNAME_UPPER}_STATIC_SRCS})
|
||||
CMAKEFILES(${all_srcs})
|
||||
|
||||
# Go all C++ if the settings request it
|
||||
SET_CXX_LANG("${all_srcs}")
|
||||
|
||||
# Add ${libname} to the list of BRL-CAD libraries
|
||||
list(APPEND BRLCAD_LIBS ${libname})
|
||||
list(REMOVE_DUPLICATES BRLCAD_LIBS)
|
||||
set(BRLCAD_LIBS "${BRLCAD_LIBS}" CACHE STRING "BRL-CAD libraries" FORCE)
|
||||
list(APPEND PROJECT_LIBS ${libname})
|
||||
list(REMOVE_DUPLICATES PROJECT_LIBS)
|
||||
set(PROJECT_LIBS "${PROJECT_LIBS}" CACHE STRING "BRL-CAD libraries" FORCE)
|
||||
|
||||
# Collect the definitions and flags needed by this library
|
||||
GET_TARGET_DEFINES(${libname} "${libslist}")
|
||||
@@ -547,7 +550,7 @@ macro(BRLCAD_ADDLIB libname srcslist libslist)
|
||||
endif(CPP_DLL_DEFINES)
|
||||
set_property(GLOBAL PROPERTY ${libname}_DLL_DEFINES "${${libname}_DLL_DEFINES}")
|
||||
|
||||
mark_as_advanced(BRLCAD_LIBS)
|
||||
mark_as_advanced(PROJECT_LIBS)
|
||||
|
||||
endmacro(BRLCAD_ADDLIB libname srcslist libslist)
|
||||
|
||||
@@ -596,7 +599,7 @@ macro(BRLCAD_SORT_INCLUDE_DIRS DIR_LIST)
|
||||
|
||||
# paths in BRL-CAD build dir
|
||||
foreach(inc_path ${${DIR_LIST}})
|
||||
IS_SUBPATH("${BRLCAD_BINARY_DIR}" "${inc_path}" SUBPATH_TEST)
|
||||
IS_SUBPATH("${CMAKE_BINARY_DIR}" "${inc_path}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "1")
|
||||
set(NEW_DIR_LIST ${NEW_DIR_LIST} ${inc_path})
|
||||
list(REMOVE_ITEM ${DIR_LIST} ${inc_path})
|
||||
@@ -605,7 +608,7 @@ macro(BRLCAD_SORT_INCLUDE_DIRS DIR_LIST)
|
||||
|
||||
# paths in BRL-CAD source dir
|
||||
foreach(inc_path ${${DIR_LIST}})
|
||||
IS_SUBPATH("${BRLCAD_SOURCE_DIR}" "${inc_path}" SUBPATH_TEST)
|
||||
IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${inc_path}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "1")
|
||||
set(NEW_DIR_LIST ${NEW_DIR_LIST} ${inc_path})
|
||||
list(REMOVE_ITEM ${DIR_LIST} ${inc_path})
|
||||
@@ -638,9 +641,9 @@ macro(BRLCAD_INCLUDE_DIRS DIR_LIST)
|
||||
|
||||
foreach(inc_dir ${INCLUDE_DIRS})
|
||||
get_filename_component(abs_inc_dir ${inc_dir} ABSOLUTE)
|
||||
IS_SUBPATH("${BRLCAD_SOURCE_DIR}" "${abs_inc_dir}" IS_LOCAL)
|
||||
IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${abs_inc_dir}" IS_LOCAL)
|
||||
if (NOT IS_LOCAL)
|
||||
IS_SUBPATH("${BRLCAD_BINARY_DIR}" "${abs_inc_dir}" IS_LOCAL)
|
||||
IS_SUBPATH("${CMAKE_BINARY_DIR}" "${abs_inc_dir}" IS_LOCAL)
|
||||
endif (NOT IS_LOCAL)
|
||||
if("${inc_dir}" MATCHES "other" OR NOT IS_LOCAL)
|
||||
# Unfortunately, a bug in the CMake SYSTEM option to
|
||||
@@ -707,7 +710,7 @@ macro(BRLCAD_MANAGE_FILES inputdata targetdir)
|
||||
endif(${ARGC} GREATER 2)
|
||||
|
||||
# Handle both a list of one or more files and variable holding a list of files -
|
||||
# find out what we've got.
|
||||
# find out what we've got, and handle CMAKEFILES itemization.
|
||||
NORMALIZE_FILE_LIST("${inputdata}" datalist fullpath_datalist targetname)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# B R L C A D _ V E R S I O N . C M A K E
|
||||
# BRL-CAD
|
||||
#
|
||||
# Copyright (c) 2011-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
###
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Define the current BRL-CAD version.
|
||||
# See HACKING for details on how to properly update the version
|
||||
|
||||
file(READ "${BRLCAD_SOURCE_DIR}/include/conf/MAJOR" BRLCAD_VERSION_MAJOR)
|
||||
string(STRIP ${BRLCAD_VERSION_MAJOR} BRLCAD_VERSION_MAJOR)
|
||||
file(READ "${BRLCAD_SOURCE_DIR}/include/conf/MINOR" BRLCAD_VERSION_MINOR)
|
||||
string(STRIP ${BRLCAD_VERSION_MINOR} BRLCAD_VERSION_MINOR)
|
||||
file(READ "${BRLCAD_SOURCE_DIR}/include/conf/PATCH" BRLCAD_VERSION_PATCH)
|
||||
string(STRIP ${BRLCAD_VERSION_PATCH} BRLCAD_VERSION_PATCH)
|
||||
|
||||
set(BRLCAD_VERSION "${BRLCAD_VERSION_MAJOR}.${BRLCAD_VERSION_MINOR}.${BRLCAD_VERSION_PATCH}")
|
||||
set(PROJ_VERSION "${BRLCAD_VERSION}")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,86 @@
|
||||
# B R L C A D _ E N V _ I N I T . C M A K E
|
||||
# BRL-CAD
|
||||
#
|
||||
# Copyright (c) 2011-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# 3. The name of the author may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
###
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Allow the BRLCAD_ROOT environment variable to set CMAKE_INSTALL_PREFIX
|
||||
# but be noisy about it. This is generally not a good idea.
|
||||
find_program(SLEEP_EXEC sleep)
|
||||
mark_as_advanced(SLEEP_EXEC)
|
||||
set(BRLCAD_ROOT "$ENV{BRLCAD_ROOT}")
|
||||
if(BRLCAD_ROOT)
|
||||
if(NOT BRLCAD_ROOT_OVERRIDE)
|
||||
message(WARNING "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\nBRLCAD_ROOT should only be used to override an install directory at runtime. BRLCAD_ROOT is presently set to \"${BRLCAD_ROOT}\" It is *highly* recommended that BRLCAD_ROOT be unset and not used.\n}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}")
|
||||
if(CMAKE_INSTALL_PREFIX AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if(${BRLCAD_ROOT} STREQUAL "${CMAKE_INSTALL_PREFIX}")
|
||||
message("BRLCAD_ROOT is not necessary and may cause unexpected behavior")
|
||||
else(${BRLCAD_ROOT} STREQUAL "${CMAKE_INSTALL_PREFIX}")
|
||||
message(FATAL_ERROR "BRLCAD_ROOT environment variable conflicts with CMAKE_INSTALL_PREFIX")
|
||||
endif(${BRLCAD_ROOT} STREQUAL "${CMAKE_INSTALL_PREFIX}")
|
||||
endif(CMAKE_INSTALL_PREFIX AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if(SLEEP_EXEC)
|
||||
execute_process(COMMAND ${SLEEP_EXEC} 2)
|
||||
endif(SLEEP_EXEC)
|
||||
endif(NOT BRLCAD_ROOT_OVERRIDE)
|
||||
endif(BRLCAD_ROOT)
|
||||
if(NOT BRLCAD_ROOT_OVERRIDE)
|
||||
if(BRLCAD_ROOT STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
|
||||
message(WARNING "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\nIt is STRONGLY recommended that you DO NOT install BRL-CAD into /usr as BRL-CAD provides several libraries that may conflict with other libraries (e.g. librt, libbu, libbn) on certain system configurations.\nSince our libraries predate all those that we're known to conflict with and are at the very core of our geometry services and project heritage, we have no plans to change the names of our libraries at this time.\nINSTALLING INTO /usr CAN MAKE A SYSTEM COMPLETELY UNUSABLE. If you choose to continue installing into /usr, you do so entirely at your own risk. You have been warned.\n}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}")
|
||||
if(SLEEP_EXEC)
|
||||
message("Pausing 15 seconds...")
|
||||
execute_process(COMMAND ${SLEEP_EXEC} 15)
|
||||
endif(SLEEP_EXEC)
|
||||
if(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
|
||||
message(FATAL_ERROR "If you wish to proceed using /usr as your prefix, define BRLCAD_ROOT_OVERRIDE=1 for CMake")
|
||||
endif(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr")
|
||||
endif(BRLCAD_ROOT STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
|
||||
endif(NOT BRLCAD_ROOT_OVERRIDE)
|
||||
|
||||
# While we're at it, complain if BRLCAD_DATA is set
|
||||
set(BRLCAD_DATA_ENV "$ENV{BRLCAD_DATA}")
|
||||
if(BRLCAD_DATA_ENV)
|
||||
message(WARNING "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\nBRLCAD_DATA should only be used to override an install directory at runtime. BRLCAD_DATA is presently set to \"${BRLCAD_DATA_ENV}\" It is *highly* recommended that BRLCAD_DATA be unset and not used.\n}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}")
|
||||
if(SLEEP_EXEC)
|
||||
execute_process(COMMAND ${SLEEP_EXEC} 2)
|
||||
endif(SLEEP_EXEC)
|
||||
endif(BRLCAD_DATA_ENV)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -53,7 +53,7 @@ if(NOT BRLCAD_IS_SUBBUILD)
|
||||
# for distcheck regardless of the build configurations used.
|
||||
|
||||
# Set up the script that will be used to verify the source archives
|
||||
configure_file("${BRLCAD_CMAKE_DIR}/distcheck_repo_verify.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake" @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/distcheck_repo_verify.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake" @ONLY)
|
||||
|
||||
# Define the repository verification build target
|
||||
add_custom_target(distcheck-repo_verify
|
||||
@@ -87,9 +87,9 @@ if(NOT BRLCAD_IS_SUBBUILD)
|
||||
macro(CREATE_DISTCHECK TARGET_SUFFIX CMAKE_OPTS_IN source_dir build_dir install_dir)
|
||||
# Check if a custom template was specified (optional)
|
||||
if(NOT "${ARGV5}" STREQUAL "")
|
||||
set(distcheck_template_file "${BRLCAD_CMAKE_DIR}/${ARGV5}")
|
||||
set(distcheck_template_file "${CMAKE_SOURCE_DIR}/misc/CMake/${ARGV5}")
|
||||
else(NOT "${ARGV5}" STREQUAL "")
|
||||
set(distcheck_template_file "${BRLCAD_CMAKE_DIR}/distcheck_target.cmake.in")
|
||||
set(distcheck_template_file "${CMAKE_SOURCE_DIR}/misc/CMake/distcheck_target.cmake.in")
|
||||
endif(NOT "${ARGV5}" STREQUAL "")
|
||||
|
||||
# If we've already got a particular distcheck target, don't try to create it again.
|
||||
|
||||
@@ -243,7 +243,7 @@ macro(ADD_DOCBOOK fmts in_xml_files outdir deps_list)
|
||||
# As long as we're outputting *something*, we have a target to produce
|
||||
if(NOT "${outputs}" STREQUAL "")
|
||||
string(MD5 path_md5 "${CMAKE_CURRENT_SOURCE_DIR}/${fname}")
|
||||
configure_file(${BRLCAD_CMAKE_DIR}/docbook.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/dbp_${fname_root}-${path_md5}.cmake @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/misc/CMake/docbook.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/dbp_${fname_root}-${path_md5}.cmake @ONLY)
|
||||
add_custom_command(
|
||||
OUTPUT ${outputs}
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/dbp_${fname_root}-${path_md5}.cmake
|
||||
|
||||
@@ -60,7 +60,7 @@ TERMLIB_CHECK_LIBRARY(TERMLIB terminfo tputs)
|
||||
TERMLIB_CHECK_LIBRARY(TERMLIB tinfo tputs)
|
||||
TERMLIB_CHECK_LIBRARY(TERMLIB ccurses tputs)
|
||||
include(CheckCSourceRuns)
|
||||
configure_file("${BRLCAD_CMAKE_DIR}/test_srcs/termlib.c.in" "${CMAKE_BINARY_DIR}/CMakeTmp/termlib.c")
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/termlib.c.in" "${CMAKE_BINARY_DIR}/CMakeTmp/termlib.c")
|
||||
set(CMAKE_REQUIRED_LIBRARIES_BAK ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${TERMLIB_LIBRARY})
|
||||
if(NOT DEFINED LIBTERM_RESULT)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Used a variation on Fraser's approach for capturing command line args from
|
||||
# http://stackoverflow.com/questions/10205986/how-to-capture-cmake-command-line-arguments
|
||||
# to log what variables have been passed in from the user via -D arguments - haven't
|
||||
# found a variable that saves the original ARGV list except for those defined in
|
||||
# -P script mode, which doesn't help here.
|
||||
get_cmake_property(VARS VARIABLES)
|
||||
foreach(VAR ${VARS})
|
||||
get_property(VAR_HELPSTRING CACHE ${VAR} PROPERTY HELPSTRING)
|
||||
# Rather than look for "No help, variable specified on the command line."
|
||||
# exactly, match a slightly more robust subset...
|
||||
string(TOLOWER "${VAR_HELPSTRING}" VAR_HELPSTRING)
|
||||
if("${VAR_HELPSTRING}" MATCHES "specified on the command line")
|
||||
get_property(VAR_TYPE CACHE ${VAR} PROPERTY TYPE)
|
||||
if(NOT VAR_TYPE STREQUAL "UNINITIALIZED")
|
||||
set(VAR "${VAR}:${VAR_TYPE}")
|
||||
endif(NOT VAR_TYPE STREQUAL "UNINITIALIZED")
|
||||
set(CMAKE_ARGS "${CMAKE_ARGS} -D${VAR}=${${VAR}}")
|
||||
endif("${VAR_HELPSTRING}" MATCHES "specified on the command line")
|
||||
endforeach(VAR ${VARS})
|
||||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeOutput.log" "${CMAKE_COMMAND} \"${CMAKE_SOURCE_DIR}\" ${CMAKE_ARGS}\n")
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
# By default (as of version 2.8.2) CMake does not provide access to
|
||||
# global lists of executable and library targets. This is useful
|
||||
# in a number of situations related to formulating custom rules and
|
||||
# target dependency management. To avoid the necessity of replacing
|
||||
# add_library and add_executable calls with custom macros, override
|
||||
# the function names and call the _add_* functions to access the CMake
|
||||
# functionality previously available under the add_* functions. See
|
||||
# http://www.cmake.org/pipermail/cmake/2010-September/039388.html
|
||||
|
||||
# We also need to provide bookkeeping logic here for the distribution
|
||||
# verification or "distcheck" routines that will validate the state
|
||||
# of the source tree against that expected and accounted for in the
|
||||
# build files. The global coverage needed for the purpose results in
|
||||
# the add_library/add_executable command override mechanism having
|
||||
# to serve two purposes at once; since we only override these functions
|
||||
# once the logic for both jobs is intertwined below.
|
||||
|
||||
# Functions in CMake have local variable scope,
|
||||
# hence the use of properties to allow access to directory-specific
|
||||
# and global information scopes.
|
||||
define_property(GLOBAL PROPERTY CMAKE_LIBRARY_TARGET_LIST BRIEF_DOCS "libtarget list" FULL_DOCS "Library target list")
|
||||
define_property(GLOBAL PROPERTY CMAKE_EXEC_TARGET_LIST BRIEF_DOCS "exec target list" FULL_DOCS "Executable target list")
|
||||
define_property(GLOBAL PROPERTY CMAKE_CUSTOM_TARGET_LIST BRIEF_DOCS "custom target list" FULL_DOCS "Custom target list")
|
||||
define_property(GLOBAL PROPERTY CMAKE_EXTERNAL_TARGET_LIST BRIEF_DOCS "external target list" FULL_DOCS "External target list")
|
||||
mark_as_advanced(CMAKE_LIBRARY_TARGET_LIST)
|
||||
mark_as_advanced(CMAKE_EXEC_TARGET_LIST)
|
||||
mark_as_advanced(CMAKE_CUSTOM_TARGET_LIST)
|
||||
mark_as_advanced(CMAKE_EXTERNAL_TARGET_LIST)
|
||||
|
||||
# Override and wrap add_library. While we're at it, avoid doubling up
|
||||
# on the lib prefix for libraries if the target name is lib<target>
|
||||
function(add_library name)
|
||||
_add_library(${name} ${ARGN})
|
||||
CMAKEFILES(${ARGN})
|
||||
set(add_lib_to_list 1)
|
||||
foreach(libarg ${ARGN})
|
||||
if("${libarg}" STREQUAL "INTERFACE")
|
||||
set(add_lib_to_list 0)
|
||||
endif("${libarg}" STREQUAL "INTERFACE")
|
||||
endforeach(libarg ${ARGN})
|
||||
if (add_lib_to_list)
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_LIBRARY_TARGET_LIST ${name})
|
||||
endif (add_lib_to_list)
|
||||
endfunction(add_library)
|
||||
|
||||
# Override and wrap add_executable
|
||||
function(add_executable name)
|
||||
_add_executable(${name} ${ARGN})
|
||||
CMAKEFILES(${ARGN})
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_EXEC_TARGET_LIST ${name})
|
||||
endfunction(add_executable)
|
||||
|
||||
# Override and wrap add_custom_target
|
||||
function(add_custom_target name)
|
||||
_add_custom_target(${name} ${ARGN})
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_CUSTOM_TARGET_LIST ${name})
|
||||
endfunction(add_custom_target)
|
||||
|
||||
# Note that at the moment we do not need to override CMake's external
|
||||
# project mechanisms because CMake does not use them, but if that changes
|
||||
# in the future an override will need to be added here - probably of the
|
||||
# ExternalProject_Add functionality.
|
||||
|
||||
# Override and wrap configure_file. In the case of configure_file, we'll
|
||||
# check that the file is part of the source tree and not itself a
|
||||
# generated file, but not reject full-path entries since there are quite a
|
||||
# few of them. This means that, unlike CMAKEFILES's reliance on full vs.
|
||||
# relative path comparisons, generated files supplied to configure_file
|
||||
# need to have the GENERATED property set in order to reliably tell which
|
||||
# files should be added to the build system's lists. Not
|
||||
# so critical with not-in-src-dir builds, but makes a big difference
|
||||
# spotting files to avoid when all generated files have source directory
|
||||
# prefixes.
|
||||
function(configure_file file targetfile)
|
||||
_configure_file(${file} ${targetfile} ${ARGN})
|
||||
# Tag output from configure with the GENERATED tag
|
||||
set_source_files_properties(${targetfile} PROPERTIES GENERATED TRUE)
|
||||
# If it's a generated file, don't register it
|
||||
get_property(IS_GENERATED SOURCE ${file} PROPERTY GENERATED)
|
||||
if(NOT IS_GENERATED)
|
||||
get_filename_component(item_absolute ${file} ABSOLUTE)
|
||||
# If we're not in the source dir, we can do some extra checking.
|
||||
if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
IS_SUBPATH("${CMAKE_BINARY_DIR}" "${item_absolute}" SUBPATH_TEST)
|
||||
else(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
set(SUBPATH_TEST "0")
|
||||
endif(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
if("${SUBPATH_TEST}" STREQUAL "0")
|
||||
IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${item_absolute}" SUBPATH_TEST)
|
||||
if("${SUBPATH_TEST}" STREQUAL "1")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${item_absolute}")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "1")
|
||||
else("${SUBPATH_TEST}" STREQUAL "0")
|
||||
message(WARNING "The generated file ${file} is passed to configure_file but does not have the GENERATED source file property set in CMake. It is HIGHLY recommended that the generated property be set for this file in \"${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt\" using a command with the following form:\nset_source_files_properties(<file> PROPERTIES GENERATED TRUE)\n(or in \"${CMAKE_SOURCE_DIR}/src/other/CMakeLists.txt\" for third party components with their own build system.)\n")
|
||||
endif("${SUBPATH_TEST}" STREQUAL "0")
|
||||
endif(NOT IS_GENERATED)
|
||||
if(NOT ${targetfile} MATCHES "distclean")
|
||||
DISTCLEAN(${targetfile})
|
||||
endif(NOT ${targetfile} MATCHES "distclean")
|
||||
endfunction(configure_file)
|
||||
|
||||
# Override and wrap add_subdirectory.
|
||||
function(add_subdirectory name)
|
||||
_add_subdirectory(${name} ${ARGN})
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${name}")
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${name}/CMakeLists.txt")
|
||||
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${name}/CMakeFiles")
|
||||
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${name}/cmake_install.cmake")
|
||||
foreach(clearpattern ${DISTCLEAN_OUTFILES})
|
||||
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${name}/${clearpattern}")
|
||||
endforeach(clearpattern ${DISTCLEAN_OUTFILES})
|
||||
endfunction(add_subdirectory)
|
||||
|
||||
|
||||
function(add_test test_name test_prog)
|
||||
_add_test(${test_name} ${test_prog} ${ARGN})
|
||||
if (NOT "${test_name}" STREQUAL "NAME")
|
||||
if (NOT "${test_name}" MATCHES ^regress- AND NOT "${test_prog}" MATCHES ^regress- AND NOT "${test_name}" STREQUAL "benchmark")
|
||||
add_dependencies(unit ${test_prog})
|
||||
add_dependencies(check ${test_prog})
|
||||
endif (NOT "${test_name}" MATCHES ^regress- AND NOT "${test_prog}" MATCHES ^regress- AND NOT "${test_name}" STREQUAL "benchmark")
|
||||
else (NOT "${test_name}" STREQUAL "NAME")
|
||||
if (NOT "${ARGV1}" MATCHES ^regress- AND NOT "${ARGV3}" MATCHES ^regress- AND NOT "${ARGV1}" MATCHES "benchmark")
|
||||
add_dependencies(unit ${ARGV3})
|
||||
add_dependencies(check ${ARGV3})
|
||||
endif (NOT "${ARGV1}" MATCHES ^regress- AND NOT "${ARGV3}" MATCHES ^regress- AND NOT "${ARGV1}" MATCHES "benchmark")
|
||||
endif (NOT "${test_name}" STREQUAL "NAME")
|
||||
endfunction(add_test)
|
||||
|
||||
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#---------------------------------------------------------------------
|
||||
# Searching the system for packages presents something of a dilemma -
|
||||
# in most situations it is Very Bad for a BRL-CAD build to be using
|
||||
# older versions of libraries in install directories as search results.
|
||||
# Generally, the desired behavior is to ignore whatever libraries are
|
||||
# in the install directories, and only use external library results if
|
||||
# they are something already found on the system due to non-BRL-CAD
|
||||
# installation (source compile, package managers, etc.). Unfortunately,
|
||||
# CMake's standard behavior is to add CMAKE_INSTALL_PREFIX to the search
|
||||
# path once defined, resulting in (for us) the unexpected behavior of
|
||||
# returning old installed libraries when CMake is re-run in a directory.
|
||||
#
|
||||
# To work around this, there are two possible approaches. One,
|
||||
# identified by Maik Beckmann, operates on CMAKE_SYSTEM_PREFIX_PATH:
|
||||
#
|
||||
# http://www.cmake.org/pipermail/cmake/2010-October/040292.html
|
||||
#
|
||||
# The other, pointed out by Michael Hertling, uses the
|
||||
# CMake_[SYSTEM_]IGNORE_PATH variables.
|
||||
#
|
||||
# http://www.cmake.org/pipermail/cmake/2011-May/044503.html
|
||||
#
|
||||
# BRL-CAD initially operated on CMAKE_SYSTEM_PREFIX_PATH, but has
|
||||
# switched to using the *_IGNORE_PATH variables. This requires
|
||||
# CMake 2.8.3 or later.
|
||||
#
|
||||
# The complication with ignoring install paths is if we are
|
||||
# installing to a "legitimate" system search path - i.e. our
|
||||
# CMAKE_INSTALL_PREFIX value is standard enough that it is a legitimate
|
||||
# search target for find_package. In this case, we can't exclude
|
||||
# accidental hits on our libraries without also excluding legitimate
|
||||
# find_package results. So the net results are:
|
||||
#
|
||||
# 1. If you are planning to install to a system directory (typically
|
||||
# a bad idea but the settings are legal) clean out the old system
|
||||
# first or accept that the old libraries will be found and used.
|
||||
#
|
||||
# 2. For more custom paths, the logic below will avoid the value
|
||||
# of CMAKE_INSTALL_PREFIX in find_package searches
|
||||
#
|
||||
# (Note: CMAKE_INSTALL_PREFIX must be checked in the case where someone
|
||||
# sets it on the command line prior to CMake being run. BRLCAD_PREFIX
|
||||
# preserves the CMAKE_INSTALL_PREFIX setting from the previous CMake run.
|
||||
# CMAKE_INSTALL_PREFIX does not seem to be immediately set in this context
|
||||
# when CMake is re-run unless specified explicitly on the command line.
|
||||
# To ensure the previous (and internally set) CMAKE_INSTALL_PREFIX value
|
||||
# is available, BRLCAD_PREFIX is used to store the value in the cache.)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX)
|
||||
if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
|
||||
get_filename_component(PATH_NORMALIZED "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" ABSOLUTE)
|
||||
set(CMAKE_SYSTEM_IGNORE_PATH "${PATH_NORMALIZED}")
|
||||
endif(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
|
||||
endif(CMAKE_INSTALL_PREFIX)
|
||||
if("${CMAKE_PROJECT_NAME}" STREQUAL "BRLCAD" AND BRLCAD_PREFIX)
|
||||
if(NOT "${BRLCAD_PREFIX}" STREQUAL "/usr" AND NOT "${BRLCAD_PREFIX}" STREQUAL "/usr/local")
|
||||
get_filename_component(PATH_NORMALIZED "${BRLCAD_PREFIX}/${LIB_DIR}" ABSOLUTE)
|
||||
set(CMAKE_SYSTEM_IGNORE_PATH "${PATH_NORMALIZED}")
|
||||
endif(NOT "${BRLCAD_PREFIX}" STREQUAL "/usr" AND NOT "${BRLCAD_PREFIX}" STREQUAL "/usr/local")
|
||||
endif("${CMAKE_PROJECT_NAME}" STREQUAL "BRLCAD" AND BRLCAD_PREFIX)
|
||||
mark_as_advanced(CMAKE_SYSTEM_IGNORE_PATH)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
define_property(GLOBAL PROPERTY CMAKE_DISTCLEAN_TARGET_LIST BRIEF_DOCS "All CMake generated files" FULL_DOCS "List of all files generated by CMake")
|
||||
macro(DISTCLEAN)
|
||||
foreach(item ${ARGN})
|
||||
set_property(GLOBAL APPEND PROPERTY CMAKE_DISTCLEAN_TARGET_LIST "${item}")
|
||||
endforeach(item ${ARGN})
|
||||
endmacro(DISTCLEAN)
|
||||
|
||||
# For cleaning files as part of the distclean command, CMake needs
|
||||
# to be aware of what various generators will (or might) write out
|
||||
# in each build directory.
|
||||
set(DISTCLEAN_OUTFILES
|
||||
CTestTestfile.cmake
|
||||
Testing/Temporary/CTestCostData.txt
|
||||
Testing/Temporary/LastTest.log
|
||||
)
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||
set(DISTCLEAN_OUTFILES ${DISTCLEAN_OUTFILES} Makefile)
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
|
||||
set(DISTCLEAN_OUTFILES ${DISTCLEAN_OUTFILES} build.ninja rules.ninja)
|
||||
endif("${CMAKE_GENERATOR}" MATCHES "Ninja")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# Unfortunately, older CMake versions don't give you variables with current
|
||||
# day, month, etc. There are several possible approaches to this, but most
|
||||
# (e.g. the date command) are not cross platform. We build a small C file which
|
||||
# writes out the needed values to files in the build directory. Those files are
|
||||
# then read and stripped by CMake. This can go away once we require a version
|
||||
# of CMake that supports string(TIMESTAMP...) command - i.e. > 2.8.10
|
||||
|
||||
set(CONFIG_TIME_DAY_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIME_DAY")
|
||||
set(CONFIG_TIME_MONTH_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIME_MONTH")
|
||||
set(CONFIG_TIME_YEAR_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIME_YEAR")
|
||||
set(CONFIG_TIMESTAMP_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIMESTAMP")
|
||||
DISTCLEAN(${CONFIG_TIME_DAY_FILE} ${CONFIG_TIME_MONTH_FILE}
|
||||
${CONFIG_TIME_YEAR_FILE} ${CONFIG_TIMESTAMP_FILE})
|
||||
file(MAKE_DIRECTORY "${BRLCAD_BINARY_DIR}/include")
|
||||
file(MAKE_DIRECTORY "${BRLCAD_BINARY_DIR}/include/conf")
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/time.c.in" "${CMAKE_BINARY_DIR}/CMakeTmp/time.c")
|
||||
TRY_RUN(TIME_RESULT TIME_COMPILED
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/time.c"
|
||||
OUTPUT_VARIABLE COMPILEMESSAGES)
|
||||
if(TIME_RESULT MATCHES "^0$")
|
||||
file(READ ${CONFIG_TIME_DAY_FILE} CONFIG_DAY)
|
||||
string(STRIP ${CONFIG_DAY} CONFIG_DAY)
|
||||
file(READ ${CONFIG_TIME_MONTH_FILE} CONFIG_MONTH)
|
||||
string(STRIP ${CONFIG_MONTH} CONFIG_MONTH)
|
||||
file(READ ${CONFIG_TIME_YEAR_FILE} CONFIG_YEAR)
|
||||
string(STRIP ${CONFIG_YEAR} CONFIG_YEAR)
|
||||
set(CONFIG_DATE "${CONFIG_YEAR}${CONFIG_MONTH}${CONFIG_DAY}")
|
||||
else(TIME_RESULT MATCHES "^0$")
|
||||
message(FATAL_ERROR "Code to determine current date and time failed!\n")
|
||||
endif(TIME_RESULT MATCHES "^0$")
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables
|
||||
# and set them to "C" so things like date output are as expected.
|
||||
set(_orig_lc_all $ENV{LC_ALL})
|
||||
set(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||
set(_orig_lang $ENV{LANG})
|
||||
if(_orig_lc_all)
|
||||
set(ENV{LC_ALL} C)
|
||||
endif(_orig_lc_all)
|
||||
if(_orig_lc_messages)
|
||||
set(ENV{LC_MESSAGES} C)
|
||||
endif(_orig_lc_messages)
|
||||
if(_orig_lang)
|
||||
set(ENV{LANG} C)
|
||||
endif(_orig_lang)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Wrap the default message() function to also append ALL messages to a
|
||||
# CMakeOutput.log file in addition to usual console printing.
|
||||
# Note - only do this after calling project, since this override seems to do
|
||||
# unexpected things to the messages returned by that command
|
||||
|
||||
function(message)
|
||||
|
||||
# bleh, don't know a clean+safe way to avoid string comparing the
|
||||
# optional arg, so we extract it and test.
|
||||
list(GET ARGV 0 MessageType)
|
||||
|
||||
if (MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR OR MessageType STREQUAL WARNING OR MessageType STREQUAL AUTHOR_WARNING OR MessageType STREQUAL STATUS)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
_message(${MessageType} "${ARGV}")
|
||||
file(APPEND "${BRLCAD_BINARY_DIR}/CMakeFiles/CMakeOutput.log" "${MessageType}: ${ARGV}\n")
|
||||
else (MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR OR MessageType STREQUAL WARNING OR MessageType STREQUAL AUTHOR_WARNING OR MessageType STREQUAL STATUS)
|
||||
_message("${ARGV}")
|
||||
file(APPEND "${BRLCAD_BINARY_DIR}/CMakeFiles/CMakeOutput.log" "${ARGV}\n")
|
||||
endif (MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR OR MessageType STREQUAL WARNING OR MessageType STREQUAL AUTHOR_WARNING OR MessageType STREQUAL STATUS)
|
||||
|
||||
# ~10% slower alternative that avoids adding '--' to STATUS messages
|
||||
# execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${ARGV}")
|
||||
|
||||
endfunction(message)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# CMake by default provides four different configurations for multi-
|
||||
# configuration build tools. We want only two - Debug and Release.
|
||||
if(CMAKE_CONFIGURATION_TYPES AND NOT "${CMAKE_CONFIGURATION_TYPES}" STREQUAL "Debug;Release")
|
||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Allowed configuration types" FORCE)
|
||||
endif(CMAKE_CONFIGURATION_TYPES AND NOT "${CMAKE_CONFIGURATION_TYPES}" STREQUAL "Debug;Release")
|
||||
|
||||
# Normalize the build type capitalization
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
|
||||
if ("${BUILD_TYPE_UPPER}" STREQUAL "RELEASE")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
|
||||
endif ("${BUILD_TYPE_UPPER}" STREQUAL "RELEASE")
|
||||
if ("${BUILD_TYPE_UPPER}" STREQUAL "DEBUG")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
|
||||
endif ("${BUILD_TYPE_UPPER}" STREQUAL "DEBUG")
|
||||
endif(CMAKE_BUILD_TYPE)
|
||||
|
||||
# Stash the build type so we can set up a drop-down menu in the gui
|
||||
if(NOT BRLCAD_IS_SUBBUILD)
|
||||
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "high level build configuration")
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "" Debug Release)
|
||||
endif(NOT BRLCAD_IS_SUBBUILD)
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
mark_as_advanced(CMAKE_BUILD_TYPE)
|
||||
else(CMAKE_CONFIGURATION_TYPES)
|
||||
mark_as_advanced(CMAKE_BUILD_TYPE)
|
||||
endif(CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# Get information necessary for target definitions
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(N)
|
||||
if(NOT N EQUAL 0)
|
||||
set(JFLAG "-j${N}")
|
||||
else(NOT N EQUAL 0)
|
||||
# Huh? No j flag if we can't get a processor count
|
||||
set(JFLAG)
|
||||
endif(NOT N EQUAL 0)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_GREATER 2.99)
|
||||
set(CONFIG $<CONFIG>)
|
||||
else(${CMAKE_VERSION} VERSION_GREATER 2.99)
|
||||
set(CONFIG $<CONFIGURATION>)
|
||||
endif(${CMAKE_VERSION} VERSION_GREATER 2.99)
|
||||
|
||||
|
||||
# "make check" runs all of the tests (unit, benchmark, and regression) that are expected to work.
|
||||
add_custom_target(check
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\"**********************************************************************\""
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "NOTE: The \\\"check\\\" a.k.a. \\\"BRL-CAD Validation Testing\\\" target runs"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " BRL-CAD\\'s unit, system, integration, benchmark \\(performance\\), and"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " regression tests. To consider a build viable for production use,"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " these tests must pass. Dependencies are compiled automatically."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\"**********************************************************************\""
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -LE \"Regression|NOT_WORKING\" -E \"^regress-|NOTE|benchmark\" ${JFLAG}
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -R \"benchmark\" --output-on-failure ${JFLAG}
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -L \"Regression\" --output-on-failure ${JFLAG}
|
||||
)
|
||||
set_target_properties(check PROPERTIES FOLDER "BRL-CAD Validation Testing")
|
||||
|
||||
|
||||
# To support "make unit" (which will build the required targets for testing
|
||||
# in the style of GNU Autotools "make check") we define a "unit" target per
|
||||
# http://www.cmake.org/Wiki/CMakeEmulateMakeCheck and have add_test
|
||||
# automatically assemble its targets into the unit dependency list.
|
||||
add_custom_target(unit
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\"**********************************************************************\""
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "NOTE: The \"unit\" a.k.a. \"BRL-CAD Unit Testing\" target runs the"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " subset of BRL-CAD's API unit tests that are expected to work (i.e.,"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " tests not currently under development). All dependencies required"
|
||||
COMMAND ${CMAKE_COMMAND} -E echo " by the tests are compiled automatically."
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\"**********************************************************************\""
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -C $CONFIG -LE \"Regression|NOT_WORKING\" -E \"^regress-|NOTE\" ${JFLAG}
|
||||
)
|
||||
set_target_properties(unit PROPERTIES FOLDER "BRL-CAD Validation Testing")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Write out entries to populate a tm struct (will be used for time
|
||||
# delta calculations later)
|
||||
|
||||
set(DELTA_START "${CMAKE_BINARY_DIR}/CMakeTmp/DELTA_START")
|
||||
configure_file("${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/timedelta_start.c.in" "${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_start.c")
|
||||
try_run(TIME_RESULT TIME_COMPILED "${CMAKE_BINARY_DIR}/CMakeTmp" "${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_start.c" OUTPUT_VARIABLE COMPILEMESSAGES)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# Package creation with CMake depends on the value of umask - if permissions
|
||||
# are such that temporary files are created without permissions needed for
|
||||
# generated packages, the resulting packages may behave badly when installed.
|
||||
# In particular, RPM packages may improperly reset permissions on core
|
||||
# directories such as /usr.
|
||||
macro(CHECK_UMASK umask_val status_var)
|
||||
string(REGEX REPLACE "[^x]" "" umask_x "${umask_val}")
|
||||
string(REGEX REPLACE "[^r]" "" umask_r "${umask_val}")
|
||||
string(LENGTH "${umask_r}" UMASK_HAVE_R)
|
||||
set(${status_var} 0)
|
||||
if(UMASK_HAVE_R AND "${umask_x}" STREQUAL "xxx")
|
||||
set(${status_var} 1)
|
||||
endif(UMASK_HAVE_R AND "${umask_x}" STREQUAL "xxx")
|
||||
endmacro(CHECK_UMASK)
|
||||
# Note - umask is not always an executable, so we can't use find_program
|
||||
# to determine whether the umask check is appropriate.
|
||||
IF(NOT WIN32)
|
||||
exec_program(umask ARGS -S OUTPUT_VARIABLE umask_curr)
|
||||
string(STRIP "${umask_curr}" umask_curr)
|
||||
CHECK_UMASK("${umask_curr}" UMASK_OK)
|
||||
if (NOT UMASK_OK)
|
||||
message(" ")
|
||||
message(WARNING "umask is set to ${umask_curr} - this setting is not recommended if one of the goals of this build is to generate packages. Use 'umask 022' for improved package behavior.")
|
||||
if(SLEEP_EXEC)
|
||||
execute_process(COMMAND ${SLEEP_EXEC} 1)
|
||||
endif(SLEEP_EXEC)
|
||||
endif (NOT UMASK_OK)
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# Decide whether to do a 32 or a 64 bit build.
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(WORD_SIZE_LABEL "Compile as 32BIT or 64BIT?")
|
||||
if(NOT BRLCAD_WORD_SIZE)
|
||||
set(BRLCAD_WORD_SIZE "AUTO" CACHE STRING WORD_SIZE_LABEL)
|
||||
endif(NOT BRLCAD_WORD_SIZE)
|
||||
set_property(CACHE BRLCAD_WORD_SIZE PROPERTY STRINGS AUTO 32BIT 64BIT)
|
||||
string(TOUPPER "${BRLCAD_WORD_SIZE}" BRLCAD_WORD_SIZE_UPPER)
|
||||
set(BRLCAD_WORD_SIZE "${BRLCAD_WORD_SIZE_UPPER}" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
if(NOT BRLCAD_WORD_SIZE MATCHES "AUTO" AND NOT BRLCAD_WORD_SIZE MATCHES "64BIT" AND NOT BRLCAD_WORD_SIZE MATCHES "32BIT")
|
||||
message(WARNING "Unknown value ${BRLCAD_WORD_SIZE} supplied for BRLCAD_WORD_SIZE - defaulting to AUTO")
|
||||
message(WARNING "Valid options are AUTO, 32BIT and 64BIT")
|
||||
set(BRLCAD_WORD_SIZE "AUTO" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
endif(NOT BRLCAD_WORD_SIZE MATCHES "AUTO" AND NOT BRLCAD_WORD_SIZE MATCHES "64BIT" AND NOT BRLCAD_WORD_SIZE MATCHES "32BIT")
|
||||
# On Windows, we can't set word size at CMake configure time - the
|
||||
# compiler chosen at the beginning dictates the result. Mark as
|
||||
# advanced in that situation.
|
||||
if(MSVC)
|
||||
mark_as_advanced(BRLCAD_WORD_SIZE)
|
||||
endif(MSVC)
|
||||
|
||||
# calculate the size of a pointer if we haven't already
|
||||
CHECK_TYPE_SIZE("void *" CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
# still not defined?
|
||||
if(NOT CMAKE_SIZEOF_VOID_P)
|
||||
message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32 bit platform")
|
||||
set(CMAKE_SIZEOF_VOID_P 4)
|
||||
endif(NOT CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
if(${BRLCAD_WORD_SIZE} MATCHES "AUTO")
|
||||
if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
|
||||
set(CMAKE_WORD_SIZE "64BIT")
|
||||
set(BRLCAD_WORD_SIZE "64BIT (AUTO)" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
|
||||
if(${CMAKE_SIZEOF_VOID_P} MATCHES "^4$")
|
||||
set(CMAKE_WORD_SIZE "32BIT")
|
||||
set(BRLCAD_WORD_SIZE "32BIT (AUTO)" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
else(${CMAKE_SIZEOF_VOID_P} MATCHES "^4$")
|
||||
if(${CMAKE_SIZEOF_VOID_P} MATCHES "^2$")
|
||||
set(CMAKE_WORD_SIZE "16BIT")
|
||||
set(BRLCAD_WORD_SIZE "16BIT (AUTO)" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
else(${CMAKE_SIZEOF_VOID_P} MATCHES "^2$")
|
||||
set(CMAKE_WORD_SIZE "8BIT")
|
||||
set(BRLCAD_WORD_SIZE "8BIT (AUTO)" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^2$")
|
||||
endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^4$")
|
||||
endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
|
||||
else(${BRLCAD_WORD_SIZE} MATCHES "AUTO")
|
||||
set(CMAKE_WORD_SIZE "${BRLCAD_WORD_SIZE}")
|
||||
endif(${BRLCAD_WORD_SIZE} MATCHES "AUTO")
|
||||
CONFIG_H_APPEND(BRLCAD "#define SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}\n")
|
||||
|
||||
# Enable/disable 64-bit build settings for MSVC, which is apparently
|
||||
# determined at the CMake generator level - need to override other
|
||||
# settings if the compiler disagrees with them.
|
||||
if(MSVC)
|
||||
if(CMAKE_CL_64)
|
||||
if(NOT ${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
set(CMAKE_WORD_SIZE "64BIT")
|
||||
if(NOT "${BRLCAD_WORD_SIZE}" MATCHES "AUTO")
|
||||
message(WARNING "Selected MSVC compiler is 64BIT - setting word size to 64BIT. To perform a 32BIT MSVC build, select the 32BIT MSVC CMake generator.")
|
||||
set(BRLCAD_WORD_SIZE "64BIT" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
endif(NOT "${BRLCAD_WORD_SIZE}" MATCHES "AUTO")
|
||||
endif(NOT ${CMAKE_WORD_SIZE} MATCHES "64BIT")
|
||||
add_definitions("-D_WIN64")
|
||||
else(CMAKE_CL_64)
|
||||
if(NOT ${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
set(CMAKE_WORD_SIZE "32BIT")
|
||||
if(NOT "${BRLCAD_WORD_SIZE}" MATCHES "AUTO")
|
||||
message(WARNING "Selected MSVC compiler is 32BIT - setting word size to 32BIT. To perform a 64BIT MSVC build, select the 64BIT MSVC CMake generator.")
|
||||
set(BRLCAD_WORD_SIZE "32BIT" CACHE STRING WORD_SIZE_LABEL FORCE)
|
||||
endif(NOT "${BRLCAD_WORD_SIZE}" MATCHES "AUTO")
|
||||
endif(NOT ${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
endif(CMAKE_CL_64)
|
||||
endif(MSVC)
|
||||
|
||||
if (APPLE)
|
||||
if (${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
set(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Building for i386" FORCE)
|
||||
endif (${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
endif (APPLE)
|
||||
|
||||
# Based on what we are doing, we may need to constrain our search paths
|
||||
#
|
||||
# NOTE: Ideally we would set a matching property for 32 bit paths
|
||||
# on systems that default to 64 bit - as of 2.8.8 CMake doesn't yet
|
||||
# support FIND_LIBRARY_USE_LIB32_PATHS. There is a bug report on the
|
||||
# topic here: http://www.cmake.org/Bug/view.php?id=11260
|
||||
#
|
||||
if(${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
|
||||
else(${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
|
||||
endif(${CMAKE_WORD_SIZE} MATCHES "32BIT")
|
||||
|
||||
# One of the problems with 32/64 building is we need to search anew
|
||||
# for 64 bit libs after a 32 bit configure, or vice versa.
|
||||
if(PREVIOUS_CONFIGURE_TYPE)
|
||||
if(NOT ${PREVIOUS_CONFIGURE_TYPE} MATCHES ${CMAKE_WORD_SIZE})
|
||||
include("${CMAKE_SOURCE_DIR}/misc/CMake/ResetCache.cmake")
|
||||
RESET_CACHE_file()
|
||||
endif(NOT ${PREVIOUS_CONFIGURE_TYPE} MATCHES ${CMAKE_WORD_SIZE})
|
||||
endif(PREVIOUS_CONFIGURE_TYPE)
|
||||
|
||||
set(PREVIOUS_CONFIGURE_TYPE ${CMAKE_WORD_SIZE} CACHE STRING "Previous configuration word size" FORCE)
|
||||
mark_as_advanced(PREVIOUS_CONFIGURE_TYPE)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -73,7 +73,7 @@ if("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED" OR "${BRLCAD_LEMON}" MATCHES "BUN
|
||||
endif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED" OR "${BRLCAD_LEMON}" MATCHES "BUNDLED")
|
||||
DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/lemon/Makefile)
|
||||
# Make sure we load FindLEMON.cmake to be able to define LEMON targets.
|
||||
include(${BRLCAD_CMAKE_DIR}/FindLEMON.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/misc/CMake/FindLEMON.cmake)
|
||||
SetTargetFolder(lemon "Compilation Utilities")
|
||||
SetTargetFolder(lempar_cp "Compilation Utilities")
|
||||
|
||||
@@ -91,7 +91,7 @@ DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/re2c/re2cParse_parser/parser.yy)
|
||||
SetTargetFolder(re2c "Compilation Utilities")
|
||||
SetTargetFolder(re2c_bootstrap "Compilation Utilities")
|
||||
# Make sure we load FindRE2C.cmake to be able to define RE2C targets.
|
||||
include(${BRLCAD_CMAKE_DIR}/FindRE2C.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/misc/CMake/FindRE2C.cmake)
|
||||
|
||||
# Perplex is set up as a misc/tools sub-build, but at this time it is
|
||||
# entirely a BRL-CAD effort and not distributed or maintained as its
|
||||
@@ -113,7 +113,7 @@ AUTO. perplex requires a working re2c.
|
||||
")
|
||||
THIRD_PARTY_EXECUTABLE(perplex perplex "BRLCAD_LEVEL2" perplex_ALIASES perplex_DESCRIPTION NOSYS)
|
||||
# Make sure we load FindPERPLEX.cmake to be able to define PERPLEX targets.
|
||||
include(${BRLCAD_CMAKE_DIR}/FindPERPLEX.cmake)
|
||||
include(${CMAKE_SOURCE_DIR}/misc/CMake/FindPERPLEX.cmake)
|
||||
|
||||
DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/perplex/Makefile)
|
||||
DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/perplex/PERPLEX_parser/parser.y)
|
||||
|
||||
@@ -10,10 +10,10 @@ set(RT_INCLUDE_DIRS
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if(BRLCAD_ENABLE_OPENCL)
|
||||
if(ENABLE_OPENCL)
|
||||
add_definitions(-DUSE_OPENCL)
|
||||
set(RT_INCLUDE_DIRS ${RT_INCLUDE_DIRS} ${OPENCL_INCLUDE_DIRS})
|
||||
endif (BRLCAD_ENABLE_OPENCL)
|
||||
endif (ENABLE_OPENCL)
|
||||
|
||||
# locally used but not needed by users of the library
|
||||
set(RT_LOCAL_INCLUDE_DIRS
|
||||
@@ -361,13 +361,13 @@ else(MSVC)
|
||||
set(LIBRT_SOURCES ${LIBRT_SOURCES} timer42.c)
|
||||
endif(MSVC)
|
||||
|
||||
if(BRLCAD_ENABLE_OPENCL)
|
||||
if(ENABLE_OPENCL)
|
||||
set(OPENCL_LIBS ${OPENCL_LIBRARIES})
|
||||
endif(BRLCAD_ENABLE_OPENCL)
|
||||
endif(ENABLE_OPENCL)
|
||||
|
||||
if(BRLCAD_ENABLE_SPR)
|
||||
if(ENABLE_SPR)
|
||||
set(SPR_LIB libSPR)
|
||||
endif(BRLCAD_ENABLE_SPR)
|
||||
endif(ENABLE_SPR)
|
||||
|
||||
BRLCAD_ADDLIB(librt "${LIBRT_SOURCES}" "${OPENCL_LIBS};${GDIAM_LIBRARY};${VDS_LIBRARY};libbrep;libbg;libbn;libbu;${OPENNURBS_LIBRARY};${P2T_LIBRARY};${SPR_LIB};${REGEX_LIBRARY};${ZLIB_LIBRARY};${TINYCTHREAD_LIBRARY};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}")
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ mark_as_advanced(M_LIBRARY)
|
||||
# building local Tcl/Tk, go ahead and enable all the packages as well - otherwise,
|
||||
# check the found Tcl/Tk and enable what it doesn't supply. If doing a non-graphical
|
||||
# build, only compile extensions that don't use Tk.
|
||||
include("${BRLCAD_CMAKE_DIR}/ThirdParty_TCL.cmake")
|
||||
include("${CMAKE_SOURCE_DIR}/misc/CMake/ThirdParty_TCL.cmake")
|
||||
|
||||
# The first package to settle is Tk itself
|
||||
set(tk_ALIASES ENABLE_TK)
|
||||
@@ -733,7 +733,7 @@ the toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system
|
||||
version if BRLCAD_BUNDLED_LIBS is also AUTO.
|
||||
")
|
||||
THIRD_PARTY(PoissonRecon SPR PoissonRecon poissonrecon_DESCRIPTION ALIASES
|
||||
${poissonrecon_ALIASES} REQUIRED_VARS "BRLCAD_ENABLE_SPR" FLAGS NOSYS)
|
||||
${poissonrecon_ALIASES} REQUIRED_VARS "ENABLE_SPR" FLAGS NOSYS)
|
||||
if(BRLCAD_SPR_BUILD)
|
||||
SetTargetFolder(PoissonRecon "Third Party Executables")
|
||||
SetTargetFolder(SurfaceTrimmer "Third Party Executables")
|
||||
|
||||
@@ -147,6 +147,7 @@ set(VDS_HDRS
|
||||
#add_definitions(-DVDS_DEBUGPRINT)
|
||||
|
||||
add_library(libvds SHARED ${CORE_SRCS})
|
||||
set_target_properties(libvds PROPERTIES PREFIX "")
|
||||
set_target_properties(libvds PROPERTIES VERSION 1.0.1 SOVERSION 1)
|
||||
if(SYS_LIBS)
|
||||
target_link_libraries(libvds ${SYS_LIBS})
|
||||
@@ -175,6 +176,7 @@ endif(MSVC)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
add_library(libvds-static STATIC ${CORE_SRCS})
|
||||
set_target_properties(libvds-static PROPERTIES PREFIX "")
|
||||
if(CMAKE_CL_64)
|
||||
set_target_properties(libvds-static PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
|
||||
endif(CMAKE_CL_64)
|
||||
|
||||
@@ -5,10 +5,10 @@ set(RTBIN_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(BRLCAD_ENABLE_OPENCL)
|
||||
if(ENABLE_OPENCL)
|
||||
add_definitions(-DUSE_OPENCL)
|
||||
set(RT_INCLUDE_DIRS ${RT_INCLUDE_DIRS} ${OPENCL_INCLUDE_DIRS})
|
||||
endif (BRLCAD_ENABLE_OPENCL)
|
||||
endif (ENABLE_OPENCL)
|
||||
|
||||
LIST(REMOVE_DUPLICATES RTBIN_INCLUDE_DIRS)
|
||||
include_directories(${RTBIN_INCLUDE_DIRS})
|
||||
@@ -23,9 +23,9 @@ if(NOT MSVC)
|
||||
set(RT_COMMON_SRCS ${RT_COMMON_SRCS} heatgraph.c)
|
||||
endif(NOT MSVC)
|
||||
|
||||
if(BRLCAD_ENABLE_OPENCL)
|
||||
if(ENABLE_OPENCL)
|
||||
set(OPENCL_LIBS ${OPENCL_LIBRARIES})
|
||||
endif(BRLCAD_ENABLE_OPENCL)
|
||||
endif(ENABLE_OPENCL)
|
||||
|
||||
BRLCAD_ADDDATA(rtexample.c sample_applications)
|
||||
|
||||
@@ -87,12 +87,14 @@ if(NOT MSVC)
|
||||
endif(NOT MSVC)
|
||||
|
||||
add_library(libremrt STATIC ${LIBREMRT_SOURCES})
|
||||
set_target_properties(libremrt PROPERTIES PREFIX "")
|
||||
if(M_LIBRARY)
|
||||
target_link_libraries(libremrt ${M_LIBRARY})
|
||||
endif(M_LIBRARY)
|
||||
set_target_properties(libremrt PROPERTIES FOLDER "BRL-CAD Static Libraries")
|
||||
|
||||
add_library(librttherm STATIC ${RT_COMMON_SRCS})
|
||||
set_target_properties(librttherm PROPERTIES PREFIX "")
|
||||
set_target_properties(librttherm PROPERTIES LINKER_LANGUAGE C)
|
||||
set_target_properties(librttherm PROPERTIES FOLDER "BRL-CAD Static Libraries")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user