Thread: [brlcad-commits] SF.net SVN: brlcad:[37933] brlcad/branches/cmake/CMakeLists.txt
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2010-03-07 23:37:03
|
Revision: 37933 http://brlcad.svn.sourceforge.net/brlcad/?rev=37933&view=rev Author: starseeker Date: 2010-03-07 23:36:57 +0000 (Sun, 07 Mar 2010) Log Message: ----------- Playing around with the CMakeLists.txt file a bit - will need to study the path settings a bit, especially how they're handled on Windows. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-03-07 17:57:26 UTC (rev 37932) +++ brlcad/branches/cmake/CMakeLists.txt 2010-03-07 23:36:57 UTC (rev 37933) @@ -88,12 +88,12 @@ ENDIF(COMMAND CMAKE_POLICY) # set CMake project name -PROJECT(BRL-CAD) +PROJECT(BRLCAD) # CMake derives much of its functionality from modules, typically # stored in one directory - let CMake know where to find them. -SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/misc/CMake") -SET(CMAKE_MODULE_PATH "${VTK_CMAKE_DIR}" ${CMAKE_MODULE_PATH}) +SET(BRLCAD_CMAKE_DIR "${BRLCAD_SOURCE_DIR}/misc/CMake") +SET(CMAKE_MODULE_PATH "${BRLCAD_CMAKE_DIR}" ${CMAKE_MODULE_PATH}) #-------------------------------------------------------------------- # BRL-CAD version numbers are read from files - to do this, support @@ -109,12 +109,12 @@ ELSE(NOT UNIX) ENDIF(WIN32) -EXEC_PROGRAM(${cat_prog} ARGS ${VTK_SOURCE_DIR}/include/conf/MAJOR OUTPUT_VARIABLE BRL-CAD_MAJOR_VERSION) -EXEC_PROGRAM(${cat_prog} ARGS ${VTK_SOURCE_DIR}/include/conf/MINOR OUTPUT_VARIABLE BRL-CAD_MINOR_VERSION) -EXEC_PROGRAM(${cat_prog} ARGS ${VTK_SOURCE_DIR}/include/conf/PATCH OUTPUT_VARIABLE BRL-CAD_PATCH_VERSION) +EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR OUTPUT_VARIABLE BRLCAD_MAJOR_VERSION) +EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/MINOR OUTPUT_VARIABLE BRLCAD_MINOR_VERSION) +EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/PATCH OUTPUT_VARIABLE BRLCAD_PATCH_VERSION) -SET(BRL-CAD_VERSION - "${BRL-CAD_MAJOR_VERSION}.${BRL-CAD_MINOR_VERSION}.${BRL-CAD_PATCH_VERSION}") +SET(BRLCAD_VERSION + "${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") # Unfortunately, CMake doesn't give you variables with current day, month, @@ -137,28 +137,29 @@ MESSAGE(STATUS) MESSAGE(STATUS) +# For NFS volumes, to ensure proper file creation +IF(NOT WIN32) + EXEC_PROGRAM(umask ARGS 022) +ENDIF(NOT WIN32) - #----------------------------------------------------------------------------- # Load some macros. -INCLUDE(${VTK_CMAKE_DIR}/vtkDependentOption.cmake) -INCLUDE(${VTK_CMAKE_DIR}/vtkThirdParty.cmake) -INCLUDE(${VTK_CMAKE_DIR}/vtkExportKit.cmake) -INCLUDE(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/vtkDependentOption.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/vtkThirdParty.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake) #----------------------------------------------------------------------------- # Choose static or shared libraries. -INCLUDE(${VTK_CMAKE_DIR}/vtkSelectSharedLibraries.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/vtkSelectSharedLibraries.cmake) #----------------------------------------------------------------------------- -# Does VTK require support for 64 bit file systems -INCLUDE(${VTK_CMAKE_DIR}/CheckCXXSourceRuns.cmake) -FILE(READ "${VTK_CMAKE_DIR}/vtkRequireLargeFilesSupport.cxx" - VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE) -CHECK_CXX_SOURCE_RUNS("${VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE}" +# Does BRLCAD require support for 64 bit file systems +INCLUDE(${BRLCAD_CMAKE_DIR}/CheckCXXSourceRuns.cmake) +FILE(READ "${BRLCAD_CMAKE_DIR}/vtkRequireLargeFilesSupport.cxx" + BRLCAD_REQUIRE_LARGE_FILE_SUPPORT_FILE) +CHECK_CXX_SOURCE_RUNS("${BRLCAD_REQUIRE_LARGE_FILE_SUPPORT_FILE}" CMAKE_REQUIRE_LARGE_FILE_SUPPORT "Support for 64 bit file systems") -SET(VTK_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT}) +SET(BRLCAD_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT}) #----------------------------------------------------------------------------- # Discover the name of the runtime library path environment variable @@ -166,70 +167,73 @@ # The result depends on the platform and on some platforms it depends on # the compiler options (32-bit vs. 64-bit). -INCLUDE(${VTK_CMAKE_DIR}/SharedLibraryPathVarName.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/SharedLibraryPathVarName.cmake) #----------------------------------------------------------------------------- # Output directories. IF(NOT LIBRARY_OUTPUT_PATH) - SET(LIBRARY_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.") + SET(LIBRARY_OUTPUT_PATH ${BRLCAD_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.") ENDIF(NOT LIBRARY_OUTPUT_PATH) IF(NOT EXECUTABLE_OUTPUT_PATH) - SET(EXECUTABLE_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.") + SET(EXECUTABLE_OUTPUT_PATH ${BRLCAD_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.") ENDIF(NOT EXECUTABLE_OUTPUT_PATH) -SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) -SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) +SET(BRLCAD_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) +SET(BRLCAD_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) #----------------------------------------------------------------------------- # Configure install locations. This allows parent projects to modify -# the install location. Optionally allow the project to specify a -# single VTK_INSTALL_ROOT which basically adds to its install prefix -# for VTK only. +# the install location. Specify a BRLCAD_INSTALL_ROOT which prefixes +# all install targets. -# The location in which to install VTK executables. -IF(NOT VTK_INSTALL_BIN_DIR) - SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin) -ENDIF(NOT VTK_INSTALL_BIN_DIR) +# The location in which to install BRLCAD. +IF(NOT BRLCAD_INSTALL_ROOT) + IF(NOT WIN32) + SET(BRLCAD_INSTALL_ROOT /usr/brlcad) + ENDIF(NOT WIN32) +ENDIF(NOT BRLCAD_INSTALL_ROOT) -# The location in which to install VTK header files. -IF(NOT VTK_INSTALL_INCLUDE_DIR) - SET(VTK_INSTALL_INCLUDE_DIR - ${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} +# The location in which to install BRLCAD executables. +IF(NOT BRLCAD_INSTALL_BIN_DIR) + SET(BRLCAD_INSTALL_BIN_DIR ${BRLCAD_INSTALL_ROOT}/bin) +ENDIF(NOT BRLCAD_INSTALL_BIN_DIR) + +# The location in which to install BRLCAD header files. +IF(NOT BRLCAD_INSTALL_INCLUDE_DIR) + SET(BRLCAD_INSTALL_INCLUDE_DIR + ${BRLCAD_INSTALL_ROOT}/include/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION} ) -ENDIF(NOT VTK_INSTALL_INCLUDE_DIR) +ENDIF(NOT BRLCAD_INSTALL_INCLUDE_DIR) -# The location in which to install VTK libraries. -IF(NOT VTK_INSTALL_LIB_DIR) - SET(VTK_INSTALL_LIB_DIR - ${VTK_INSTALL_ROOT}/lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} +# The location in which to install BRL-CAD libraries. +IF(NOT BRLCAD_INSTALL_LIB_DIR) + SET(BRLCAD_INSTALL_LIB_DIR + ${BRLCAD_INSTALL_ROOT}/lib/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION} ) -ENDIF(NOT VTK_INSTALL_LIB_DIR) +ENDIF(NOT BRLCAD_INSTALL_LIB_DIR) -# The location in which to install CMake scripts for packaging VTK. -IF(NOT VTK_INSTALL_PACKAGE_DIR) - SET(VTK_INSTALL_PACKAGE_DIR ${VTK_INSTALL_LIB_DIR}) -ENDIF(NOT VTK_INSTALL_PACKAGE_DIR) +# The location in which to install CMake scripts for packaging BRLCAD. +IF(NOT BRLCAD_INSTALL_PACKAGE_DIR) + SET(BRLCAD_INSTALL_PACKAGE_DIR ${BRLCAD_INSTALL_LIB_DIR}) +ENDIF(NOT BRLCAD_INSTALL_PACKAGE_DIR) -# The location in which to install VTK doxygen documentation helper +# The location in which to install BRL-CAD doxygen documentation helper # files. -IF(NOT VTK_INSTALL_DOXYGEN_DIR) - SET(VTK_INSTALL_DOXYGEN_DIR ${VTK_INSTALL_PACKAGE_DIR}/doxygen) -ENDIF(NOT VTK_INSTALL_DOXYGEN_DIR) +IF(NOT BRLCAD_INSTALL_DOXYGEN_DIR) + SET(BRLCAD_INSTALL_DOXYGEN_DIR ${BRLCAD_INSTALL_PACKAGE_DIR}/doxygen) +ENDIF(NOT BRLCAD_INSTALL_DOXYGEN_DIR) -# The location in which to install VTK documentation files that +# The location in which to install BRL-CAD documentation files that # are not automatically generated. -IF(NOT VTK_INSTALL_DOC_DIR) - SET(VTK_INSTALL_DOC_DIR ${VTK_INSTALL_PACKAGE_DIR}/doc) -ENDIF(NOT VTK_INSTALL_DOC_DIR) +IF(NOT BRLCAD_INSTALL_DOC_DIR) + SET(BRLCAD_INSTALL_DOC_DIR ${BRLCAD_INSTALL_PACKAGE_DIR}/doc) +ENDIF(NOT BRLCAD_INSTALL_DOC_DIR) # Compute the proper location for installing the Tcl package. This # must be a fixed relative path below the library install location and # is therefore not settable by parent projects. -SET(VTK_INSTALL_TCL_DIR ${VTK_INSTALL_LIB_DIR}) +SET(BRLCAD_INSTALL_TCL_DIR ${BRLCAD_INSTALL_LIB_DIR}) -IF(NOT VTK_INSTALL_JAVA_DIR) - SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java) -ENDIF(NOT VTK_INSTALL_JAVA_DIR) # There are three basic components to the VTK installation: runtime, # development, and documentation. Install rules for each component This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-26 13:56:39
|
Revision: 39903 http://brlcad.svn.sourceforge.net/brlcad/?rev=39903&view=rev Author: starseeker Date: 2010-07-26 13:56:33 +0000 (Mon, 26 Jul 2010) Log Message: ----------- See what enabling src/other/libz as a subdir does... Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-26 13:55:07 UTC (rev 39902) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-26 13:56:33 UTC (rev 39903) @@ -210,7 +210,8 @@ OPTION(BRLCAD_USE_SYSTEM_LIBS "Use the system's libraries." OFF) BRLCAD_THIRD_PARTY_OPTION(ZLIB zlib) - IF(BRLCAD_USE_SYSTEM_LIBS) SET(BRLCAD_USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system's zlib library" FORCE) ENDIF(BRLCAD_USE_SYSTEM_LIBS) + +BRLCAD_THIRD_PARTY_SUBDIR(ZLIB src/other/libz) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-26 14:33:27
|
Revision: 39904 http://brlcad.svn.sourceforge.net/brlcad/?rev=39904&view=rev Author: starseeker Date: 2010-07-26 14:33:20 +0000 (Mon, 26 Jul 2010) Log Message: ----------- Hrm. Looks like something along the lines of this approach will be needed for switching between system and local libs - gonna need to figure out how to set a BRLCAD specific variable for libz library based on the subdirectory CMake variables... back to the CMake book. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-26 13:56:33 UTC (rev 39903) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-26 14:33:20 UTC (rev 39904) @@ -213,5 +213,12 @@ IF(BRLCAD_USE_SYSTEM_LIBS) SET(BRLCAD_USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system's zlib library" FORCE) ENDIF(BRLCAD_USE_SYSTEM_LIBS) +IF(NOT BRLCAD_USE_SYSTEM_ZLIB) + SET(BRLCAD_ZLIB_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/libz" CACHE STRING "Directory containing zlib headers" FORCE) +ELSE(NOT BRLCAD_USE_SYSTEM_ZLIB) + SET(BRLCAD_ZLIB_INCLUDE_DIR "${ZLIB_INCLUDE_DIR}" CACHE STRING "Directory containing zlib headers" FORCE) +ENDIF(NOT BRLCAD_USE_SYSTEM_ZLIB) BRLCAD_THIRD_PARTY_SUBDIR(ZLIB src/other/libz) + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-26 14:41:06
|
Revision: 39905 http://brlcad.svn.sourceforge.net/brlcad/?rev=39905&view=rev Author: starseeker Date: 2010-07-26 14:41:00 +0000 (Mon, 26 Jul 2010) Log Message: ----------- hah, date stuff does work - just print it properly. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-26 14:33:20 UTC (rev 39904) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-26 14:41:00 UTC (rev 39905) @@ -134,7 +134,7 @@ # strings of the right length, so use extra lines around the title MESSAGE(STATUS) MESSAGE(STATUS) -MESSAGE(STATUS "*** Configuring BRL-CAD Release $BRLCAD_VERSION, Build $CONFIG_DATE ***") +MESSAGE(STATUS "*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build $CONFIG_DATE ***") MESSAGE(STATUS) MESSAGE(STATUS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-27 03:29:39
|
Revision: 39908 http://brlcad.svn.sourceforge.net/brlcad/?rev=39908&view=rev Author: starseeker Date: 2010-07-27 03:29:33 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Add some comments. It is NOT clear, unfortunately, whether this will result in a working setup after a make install... Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-27 03:10:22 UTC (rev 39907) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-27 03:29:33 UTC (rev 39908) @@ -205,10 +205,24 @@ ENDIF(NOT BRLCAD_INSTALL_DOXYGEN_DIR) #--------------------------------------------------------------------------------- -# Build Options +# Optionally Building Local Copies of External Libraries +# +# Need to get a bit fancy here - since we want to be able to turn local libs +# on/off at will, need to be careful about how we handle key variables. Approach +# is to stash values in BRLCAD_* prefixed versions, then restore them after +# the various Find*.cmake commands do their thing. If NOT doing local build, +# then the BRLCAD_* and standard variables will be the same. It remains to be +# seen if there will be enough consistency for a macro - the variables that +# need to be overridden will vary depending on the particular tests made by each +# subdirectory's CMake logic. #--------------------------------------------------------------------------------- + +# This is our "heavy hammer" flag - if this is set, assume system for +# everything. As yet, there is no "automatic" logic to toggle specific +# libraries on if detection fails, but that may be possible. OPTION(BRLCAD_USE_SYSTEM_LIBS "Use the system's libraries." OFF) +# zlib Library BRLCAD_THIRD_PARTY_OPTION(ZLIB zlib) BRLCAD_THIRD_PARTY_SUBDIR(ZLIB src/other/libz) IF(BRLCAD_USE_SYSTEM_LIBS) @@ -223,7 +237,14 @@ SET(BRLCAD_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE STRING "zlib library" FORCE) ENDIF(NOT BRLCAD_USE_SYSTEM_ZLIB) +# libpng Library - Checks for ZLIB, so need to restore BRLCAD_ZLIB* settings - a +# successful search by FindZLIB will reset the basic variables. If not using local +# copy of zlib, FindZLIB results will be identical in both cases so there is no +# danger of harming the libpng setup by changing BRLCAD_ZLIB*. BRLCAD_THIRD_PARTY_OPTION(PNG libpng) +SET(ZLIB_INCLUDE_DIR "${BRLCAD_ZLIB_INCLUDE_DIR}" CACHE STRING "Directory containing zlib headers" FORCE) +SET(ZLIB_LIBRARY "${BRLCAD_ZLIB_LIBRARY}" CACHE STRING "zlib library" FORCE) +BRLCAD_THIRD_PARTY_SUBDIR(PNG src/other/libpng) IF(BRLCAD_USE_SYSTEM_LIBS) SET(BRLCAD_USE_SYSTEM_PNG ON CACHE BOOL "Use the system's libpng library" FORCE) ENDIF(BRLCAD_USE_SYSTEM_LIBS) @@ -233,6 +254,4 @@ SET(BRLCAD_PNG_INCLUDE_DIR "${PNG_INCLUDE_DIR}" CACHE STRING "Directory containing libpng headers" FORCE) ENDIF(NOT BRLCAD_USE_SYSTEM_PNG) -BRLCAD_THIRD_PARTY_SUBDIR(PNG src/other/libpng) -SET(ZLIB_INCLUDE_DIR "${BRLCAD_ZLIB_INCLUDE_DIR}" CACHE STRING "Directory containing zlib headers" FORCE) -SET(ZLIB_LIBRARY "${BRLCAD_ZLIB_LIBRARY}" CACHE STRING "zlib library" FORCE) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-27 03:36:41
|
Revision: 39909 http://brlcad.svn.sourceforge.net/brlcad/?rev=39909&view=rev Author: starseeker Date: 2010-07-27 03:36:35 +0000 (Tue, 27 Jul 2010) Log Message: ----------- OK, make this a little easier to test - set up to install in a subdir of /usr/brlcad by default... Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-27 03:29:33 UTC (rev 39908) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-27 03:36:35 UTC (rev 39909) @@ -166,10 +166,13 @@ # The location in which to install BRLCAD. IF(NOT BRLCAD_INSTALL_ROOT) IF(NOT WIN32) - SET(BRLCAD_INSTALL_ROOT /usr/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}) + SET(BRLCAD_INSTALL_ROOT /usr/brlcad/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}) ENDIF(NOT WIN32) ENDIF(NOT BRLCAD_INSTALL_ROOT) +SET(CMAKE_INSTALL_PREFIX ${BRLCAD_INSTALL_ROOT}) +SET(CMAKE_INSTALL_PREFIX "${BRLCAD_INSTALL_ROOT}" CACHE STRING "prefix" FORCE) + # The location in which to install BRLCAD executables. IF(NOT BRLCAD_INSTALL_BIN_DIR) SET(BRLCAD_INSTALL_BIN_DIR ${BRLCAD_INSTALL_ROOT}/bin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-27 14:53:03
|
Revision: 39913 http://brlcad.svn.sourceforge.net/brlcad/?rev=39913&view=rev Author: starseeker Date: 2010-07-27 14:52:56 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Put in some date logic - try d_rossberg's execute_process on Windows, and otherwise do the standard configure.ac trick with the date command. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-27 13:09:25 UTC (rev 39912) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-27 14:52:56 UTC (rev 39913) @@ -118,18 +118,18 @@ # Unfortunately, CMake doesn't give you variables with current day, month, -# etc. Will have to prepare cross platform solution, which looks like it will -# mean defining a SystemDateTime.cmake file to include which will require the -# following: +# etc. For Windows use d_rossberg's execute_process, which doesn't give individual +# day, month, etc. values but does give us something for the banner. Otherwise, +# use the date command. +IF(WIN32) + execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE CONFIG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) +ELSE(WIN32) + EXEC_PROGRAM(date ARGS +%d OUTPUT_VARIABLE CONFIG_DAY) + EXEC_PROGRAM(date ARGS +%m OUTPUT_VARIABLE CONFIG_MONTH) + EXEC_PROGRAM(date ARGS +%Y OUTPUT_VARIABLE CONFIG_YEAR) + SET(CONFIG_DATE "${CONFIG_YEAR}${CONFIG_MONTH}${CONFIG_DAY}") +ENDIF(WIN32) -# 1. A Windows bat file worked out along the lines of the examples here: -# http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-usi -# This may come in handy, depending: http://www.mail-archive.com/cm...@cm.../msg16686.html -# 2. The date scripts from the BRL-CAD configure.ac -# 3. Platform conditional execution as above - -SET(CONFIG_DATE "NOTIMPLEMENTED") - # CMake doesn't seem to allow for the fancy separator logic to generate "*" # strings of the right length, so use extra lines around the title MESSAGE(STATUS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-27 15:50:43
|
Revision: 39915 http://brlcad.svn.sourceforge.net/brlcad/?rev=39915&view=rev Author: starseeker Date: 2010-07-27 15:50:36 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Get rid of stray line Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-27 15:09:52 UTC (rev 39914) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-27 15:50:36 UTC (rev 39915) @@ -170,7 +170,6 @@ ENDIF(NOT WIN32) ENDIF(NOT BRLCAD_INSTALL_ROOT) -SET(CMAKE_INSTALL_PREFIX ${BRLCAD_INSTALL_ROOT}) SET(CMAKE_INSTALL_PREFIX "${BRLCAD_INSTALL_ROOT}" CACHE STRING "prefix" FORCE) # The location in which to install BRLCAD executables. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-07-29 05:33:58
|
Revision: 39962 http://brlcad.svn.sourceforge.net/brlcad/?rev=39962&view=rev Author: starseeker Date: 2010-07-29 05:33:52 +0000 (Thu, 29 Jul 2010) Log Message: ----------- Hmm, build with external libpng is resulting in one undefined symbol... must be using wrong include path? Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-07-29 01:16:42 UTC (rev 39961) +++ brlcad/branches/cmake/CMakeLists.txt 2010-07-29 05:33:52 UTC (rev 39962) @@ -259,7 +259,7 @@ get_directory_property(BRLCAD_PNG_LIB_NAME DIRECTORY src/other/libpng DEFINITION PNG_LIB_NAME) SET(BRLCAD_PNG_LIB_NAME "${BRLCAD_PNG_LIB_NAME}" CACHE STRING "libpng name for targets" FORCE) ELSE(NOT BRLCAD_USE_SYSTEM_PNG) - SET(BRLCAD_PNG_INCLUDE_DIR "${PNG_INCLUDE_DIR}" CACHE STRING "Directory containing libpng headers" FORCE) + SET(BRLCAD_PNG_INCLUDE_DIR "${PNG_PNG_INCLUDE_DIR}" CACHE STRING "Directory containing libpng headers" FORCE) SET(BRLCAD_PNG_LIB_NAME "${PNG_LIBRARY}" CACHE STRING "libpng name for targets" FORCE) ENDIF(NOT BRLCAD_USE_SYSTEM_PNG) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_r...@us...> - 2010-08-03 08:20:19
|
Revision: 39994 http://brlcad.svn.sourceforge.net/brlcad/?rev=39994&view=rev Author: d_rossberg Date: 2010-08-03 08:20:13 +0000 (Tue, 03 Aug 2010) Log Message: ----------- changed to the CMake way to read from files Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-02 15:05:11 UTC (rev 39993) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-03 08:20:13 UTC (rev 39994) @@ -95,24 +95,14 @@ SET(BRLCAD_CMAKE_DIR "${BRLCAD_SOURCE_DIR}/misc/CMake") SET(CMAKE_MODULE_PATH "${BRLCAD_CMAKE_DIR}" ${CMAKE_MODULE_PATH}) -#-------------------------------------------------------------------- -# BRL-CAD version numbers are read from files - to do this, support -# for reading the values into variables via cat is needed (thanks -# to Andy Cedilnik on the CMake list for demonstrating how to use -# this technique with CMake) -# http://www.cmake.org/pipermail/cmake/2003-March/003486.html -SET(cat_prog cat) -IF(WIN32) - IF(NOT UNIX) - SET(cat_prog type) - ENDIF(NOT UNIX) -ENDIF(WIN32) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR BRLCAD_MAJOR_VERSION) +STRING(STRIP ${BRLCAD_MAJOR_VERSION} BRLCAD_MAJOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MINOR BRLCAD_MINOR_VERSION) +STRING(STRIP ${BRLCAD_MINOR_VERSION} BRLCAD_MINOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/PATCH BRLCAD_PATCH_VERSION) +STRING(STRIP ${BRLCAD_PATCH_VERSION} BRLCAD_PATCH_VERSION) -EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR OUTPUT_VARIABLE BRLCAD_MAJOR_VERSION) -EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/MINOR OUTPUT_VARIABLE BRLCAD_MINOR_VERSION) -EXEC_PROGRAM(${cat_prog} ARGS ${BRLCAD_SOURCE_DIR}/include/conf/PATCH OUTPUT_VARIABLE BRLCAD_PATCH_VERSION) - SET(BRLCAD_VERSION "${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-04 00:32:33
|
Revision: 39999 http://brlcad.svn.sourceforge.net/brlcad/?rev=39999&view=rev Author: starseeker Date: 2010-08-04 00:32:27 +0000 (Wed, 04 Aug 2010) Log Message: ----------- Hmm - add example from J Decker on cmake list on using set_property, with the addition of FORCE - may or may not want this specific toggle but the technique is important - will allow for three-way Yes/No/Auto logic in CMake like that found in BRL-CAD's autotools setup Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-03 19:20:17 UTC (rev 39998) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-04 00:32:27 UTC (rev 39999) @@ -228,6 +228,13 @@ FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/USER "1") +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +set(CMAKE_BUILD_TYPE "Debug" CACHE STRING + "Set build type" FORCE) + + + #--------------------------------------------------------------------------------- # Optionally Building Local Copies of External Libraries # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-05 00:09:31
|
Revision: 40008 http://brlcad.svn.sourceforge.net/brlcad/?rev=40008&view=rev Author: starseeker Date: 2010-08-05 00:09:24 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Probably not in a working state (no cmake handy to test) but start fleshing out the contents of this file - gonna need to express what's in configure.ac in here, although for most options the 'auto' setting in configure.ac will just translate to some up-front testing... Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-04 20:36:06 UTC (rev 40007) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-05 00:09:24 UTC (rev 40008) @@ -1,7 +1,7 @@ # C M A K E L I S T S . T X T # BRL-CAD # -# Copyright (c) 2004-2010 United States Government as represented by +# Copyright (c) 2010 United States Government as represented by # the U.S. Army Research Laboratory. # # Redistribution and use in source and binary forms, with or without @@ -90,53 +90,105 @@ # set CMake project name PROJECT(BRLCAD) +# See HACKING for details on how to properly update the version +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR MAJOR_VERSION) +STRING(STRIP ${MAJOR_VERSION} MAJOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MINOR MINOR_VERSION) +STRING(STRIP ${MINOR_VERSION} MINOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/PATCH PATCH_VERSION) +STRING(STRIP ${PATCH_VERSION} PATCH_VERSION) + +SET(CAD_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") +SET(BRLCAD_VERSION "${CAD_VERSION}") + # CMake derives much of its functionality from modules, typically # stored in one directory - let CMake know where to find them. SET(BRLCAD_CMAKE_DIR "${BRLCAD_SOURCE_DIR}/misc/CMake") SET(CMAKE_MODULE_PATH "${BRLCAD_CMAKE_DIR}" ${CMAKE_MODULE_PATH}) +# 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) -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR BRLCAD_MAJOR_VERSION) -STRING(STRIP ${BRLCAD_MAJOR_VERSION} BRLCAD_MAJOR_VERSION) -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MINOR BRLCAD_MINOR_VERSION) -STRING(STRIP ${BRLCAD_MINOR_VERSION} BRLCAD_MINOR_VERSION) -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/PATCH BRLCAD_PATCH_VERSION) -STRING(STRIP ${BRLCAD_PATCH_VERSION} BRLCAD_PATCH_VERSION) -SET(BRLCAD_VERSION - "${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") +# Unfortunately, CMake doesn't give you variables with current day, month, +# etc. For Windows use d_rossberg's execute_process approach, which doesn't give individual +# day, month, etc. values but does give us something we can work with. Otherwise, +# use the date command. +# TODO - figure out REGEX to get desired variables out of win32 string -# Unfortunately, CMake doesn't give you variables with current day, month, -# etc. For Windows use d_rossberg's execute_process, which doesn't give individual -# day, month, etc. values but does give us something for the banner. Otherwise, -# use the date command. IF(WIN32) execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE CONFIG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE CONFIG_TS OUTPUT_STRIP_TRAILING_WHITESPACE) +# SET(TMPSTR "Wed 08/04/2010") +# SET(TMPSTR2 "06:57 PM") + # STRING(REGEX REPLACE ... ELSE(WIN32) EXEC_PROGRAM(date ARGS +%d OUTPUT_VARIABLE CONFIG_DAY) EXEC_PROGRAM(date ARGS +%m OUTPUT_VARIABLE CONFIG_MONTH) EXEC_PROGRAM(date ARGS +%Y OUTPUT_VARIABLE CONFIG_YEAR) SET(CONFIG_DATE "${CONFIG_YEAR}${CONFIG_MONTH}${CONFIG_DAY}") + # try RFC 2822 for timestamp + EXEC_PROGRAM(date ARGS -R 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) + IF (NOT CONFIG_TS) EXEC_PROGRAM(date ARGS +'%a, %d %b %Y %H:%M:%S %z' 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) ENDIF(NOT CONFIG_TS) + IF (NOT CONFIG_TS) EXEC_PROGRAM(date ARGS OUTPUT_VARIABLE CONFIG_TS) ENDIF(NOT CONFIG_TS) ENDIF(WIN32) -# CMake doesn't seem to allow for the fancy separator logic to generate "*" -# strings of the right length, so use extra lines around the title -MESSAGE(STATUS) -MESSAGE(STATUS) -MESSAGE(STATUS "*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build ${CONFIG_DATE} ***") -MESSAGE(STATUS) -MESSAGE(STATUS) +# Set build type here? May be useful for picking intelligent defaults +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +set(CMAKE_BUILD_TYPE "Debug" CACHE STRING + "Set build type" FORCE) -# For NFS volumes, to ensure proper file creation + + +# print out the title with a pretty box computed to wrap around +SET(CONFIG_TITLE "*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build ${CONFIG_DATE} ***") +STRING(LENGTH ${CONFIG_TITLE_LENGTH} CONFIG_TITLE_LENGTH) +SET(SEPARATOR_STRING "*") +STRING(LENGTH ${SEPARATOR_STRING} SEPARATOR_STRING_LENGTH) +WHILE(CONFIG_TITLE_LENGTH > SEPARATOR_STRING_LENGTH) + SET(SEPARATOR_STRING "${SEPARATOR_STRING}*") + STRING(LENGTH ${SEPARATOR_STRING} SEPARATOR_STRING_LENGTH) +ENDWHILE(CONFIG_TITLE_LENGTH > SEPARATOR_STRING_LENGTH) +MESSAGE(STATUS "${SEPARATOR_STRING}") +MESSAGE(STATUS "${CONFIG_TITLE}") +MESSAGE(STATUS "${SEPARATOR_STRING}") + +# For NFS volumes, to ensure proper file creation. IF(NOT WIN32) EXEC_PROGRAM(umask ARGS 022) ENDIF(NOT WIN32) -#----------------------------------------------------------------------------- -# Load some macros. -INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ThirdParty.cmake) +# The location in which to install BRLCAD. What is this for Windows? +# This would be a good setting to conditionalize based on a flag for debug +# vs. release vs. ?? - set different defaults accordingly. +IF(NOT BRLCAD_PREFIX) + IF(NOT WIN32) +# SET(BRLCAD_PREFIX "/usr/brlcad/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") +# SET(BRLCAD_PREFIX "${BRLCAD_SOURCE_DIR}/../brlcad-install") + SET(BRLCAD_PREFIX "/usr/brlcad") + ENDIF(NOT WIN32) +ENDIF(NOT BRLCAD_PREFIX) + +SET(CMAKE_INSTALL_PREFIX "${BRLCAD_PREFIX}" CACHE STRING "prefix" FORCE) + +# TODO - need to replace the functionality of BC_BRLCAD_ROOT and BC_BRLCAD_DATA here, +# if it's not already being handled - the data directory at least is likely to need some help + #----------------------------------------------------------------------------- # Output directories. IF(NOT LIBRARY_OUTPUT_PATH) @@ -150,33 +202,23 @@ #----------------------------------------------------------------------------- # Configure install locations. This allows parent projects to modify -# the install location. Specify a BRLCAD_INSTALL_ROOT which prefixes +# the install location. Specify a BRLCAD_PREFIX which prefixes # all install targets. - -# The location in which to install BRLCAD. -IF(NOT BRLCAD_INSTALL_ROOT) - IF(NOT WIN32) - SET(BRLCAD_INSTALL_ROOT /usr/brlcad/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}) - ENDIF(NOT WIN32) -ENDIF(NOT BRLCAD_INSTALL_ROOT) - -SET(CMAKE_INSTALL_PREFIX "${BRLCAD_INSTALL_ROOT}" CACHE STRING "prefix" FORCE) - # The location in which to install BRLCAD executables. IF(NOT BRLCAD_INSTALL_BIN_DIR) - SET(BRLCAD_INSTALL_BIN_DIR ${BRLCAD_INSTALL_ROOT}/bin) + SET(BRLCAD_INSTALL_BIN_DIR ${BRLCAD_PREFIX}/bin) ENDIF(NOT BRLCAD_INSTALL_BIN_DIR) # The location in which to install BRLCAD header files. IF(NOT BRLCAD_INSTALL_INCLUDE_DIR) SET(BRLCAD_INSTALL_INCLUDE_DIR - ${BRLCAD_INSTALL_ROOT}/include) + ${BRLCAD_PREFIX}/include) ENDIF(NOT BRLCAD_INSTALL_INCLUDE_DIR) # The location in which to install BRL-CAD libraries. IF(NOT BRLCAD_INSTALL_LIB_DIR) SET(BRLCAD_INSTALL_LIB_DIR - ${BRLCAD_INSTALL_ROOT}/lib) + ${BRLCAD_PREFIX}/lib) ENDIF(NOT BRLCAD_INSTALL_LIB_DIR) # The location in which to install CMake scripts for packaging BRLCAD. @@ -184,30 +226,51 @@ SET(BRLCAD_INSTALL_PACKAGE_DIR ${BRLCAD_INSTALL_LIB_DIR}) ENDIF(NOT BRLCAD_INSTALL_PACKAGE_DIR) -# The location in which to install BRL-CAD documentation files that -# are not automatically generated. +# The location in which to install BRL-CAD documentation files IF(NOT BRLCAD_INSTALL_DOC_DIR) - SET(BRLCAD_INSTALL_DOC_DIR ${BRLCAD_INSTALL_PACKAGE_DIR}/doc) + SET(BRLCAD_INSTALL_DOC_DIR ${BRLCAD_PREFIX}/share/brlcad/doc) ENDIF(NOT BRLCAD_INSTALL_DOC_DIR) # The location in which to install BRL-CAD doxygen documentation helper # files. IF(NOT BRLCAD_INSTALL_DOXYGEN_DIR) - SET(BRLCAD_INSTALL_DOXYGEN_DIR ${BRLCAD_INSTALL_PACKAGE_DIR}/doc/doxygen) + SET(BRLCAD_INSTALL_DOXYGEN_DIR ${BRLCAD_INSTALL_DOC_DIR}/doxygen) ENDIF(NOT BRLCAD_INSTALL_DOXYGEN_DIR) -#--------------------------------------------------------------------------------- # We will need a brlcad_config.h.in file to hold all the #cmakedefine statements, -# which will in turn need to generate a brlcad_conf.h file. In autotools this +# 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 run this macro, the file must first be present, which # we take care of here: -SET(CONFIG_H_FILE "${BRLCAD_SOURCE_DIR}/include/brlcad_config.h.in") +SET(CONFIG_H_FILE "${BRLCAD_BINARY_DIR}/include/brlcad_config.h.in") FILE(WRITE ${CONFIG_H_FILE} "/**** Define statements for CMake ****/\n") -INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) +#-------------------------------------------------------------------------------- +# Now we define the various options for BRL-CAD things the user can enable and +# disable. As much as possible, autodetect sane default options. + +# Sometimes an option no longer makes sense in light of other options, +# or a new option becomes available when others are enabled - load a +# macro to help with those cases. +INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_Dependent_Options.cmake) + + +OPTION(BRLCAD-BUILD_BENCHMARK_ONLY "Only build benchmark." OFF) +MARK_AS_ADVANCED(BRLCAD-BUILD_BENCHMARK_ONLY) +OPTION(BRLCAD-BUILD_RTSERVER_ONLY "Only build rtserver." OFF) +MARK_AS_ADVANCED(BRLCAD-BUILD_RTSERVER_ONLY) + +# This is the top level control property for handling library building +set_property(CACHE BRLCAD-BUILD_SRC_OTHER PROPERTY STRINGS + "Yes" "No" "Auto") +set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING + "Set build type" FORCE) + +# + + BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR) BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL) @@ -220,7 +283,6 @@ BRLCAD_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) BRLCAD_TYPE_SIZE("ssize_t" SSIZE_T) -configure_file(${CONFIG_H_FILE} ${BRLCAD_SOURCE_DIR}/include/brlcad_config.h) FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/COUNT "1") FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/DATE "1") FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/HOST "1") @@ -228,11 +290,13 @@ FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/USER "1") -set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -set(CMAKE_BUILD_TYPE "Debug" CACHE STRING - "Set build type" FORCE) +# Now that all the tests are done, configure the brlcad_config.h file: +INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) +configure_file(${CONFIG_H_FILE} ${BRLCAD_BINARY_DIR}/include/brlcad_config.h) +#----------------------------------------------------------------------------- +# Load some CMake macros to handle the special case of third party libraries. +INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ThirdParty.cmake) #--------------------------------------------------------------------------------- @@ -333,7 +397,7 @@ #ExternalProject_Add( # tk # DOWNLOAD_COMMAND "" -# PREFIX "${BRLCAD_INSTALL_ROOT}" +# PREFIX "${BRLCAD_PREFIX}" # SOURCE_DIR "${BRLCAD_SOURCE_DIR}/src/other/tk" # CONFIGURE_COMMAND # autoconf -I ${BRLCAD_SOURCE_DIR}/src/other/tk/unix -o ${BRLCAD_SOURCE_DIR}/src/other/tk/unix/configure ${BRLCAD_SOURCE_DIR}/src/other/tk/unix/configure.in && ${BRLCAD_SOURCE_DIR}/src/other/tk/unix/configure --with-tk=${BRLCAD_SOURCE_DIR}/src/other/tk/unix This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-05 03:16:33
|
Revision: 40009 http://brlcad.svn.sourceforge.net/brlcad/?rev=40009&view=rev Author: starseeker Date: 2010-08-05 03:16:27 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Fix a few gotchas - CMake is now doing the pretty-print banner a.l.a configure - figured out how to generate the spacers. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-05 00:09:24 UTC (rev 40008) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-05 03:16:27 UTC (rev 40009) @@ -142,8 +142,12 @@ SET(CONFIG_DATE "${CONFIG_YEAR}${CONFIG_MONTH}${CONFIG_DAY}") # try RFC 2822 for timestamp EXEC_PROGRAM(date ARGS -R 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) - IF (NOT CONFIG_TS) EXEC_PROGRAM(date ARGS +'%a, %d %b %Y %H:%M:%S %z' 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) ENDIF(NOT CONFIG_TS) - IF (NOT CONFIG_TS) EXEC_PROGRAM(date ARGS OUTPUT_VARIABLE CONFIG_TS) ENDIF(NOT CONFIG_TS) + IF (NOT CONFIG_TS) + EXEC_PROGRAM(date ARGS +'%a, %d %b %Y %H:%M:%S %z' 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) + ENDIF(NOT CONFIG_TS) + IF (NOT CONFIG_TS) + EXEC_PROGRAM(date ARGS OUTPUT_VARIABLE CONFIG_TS) + ENDIF(NOT CONFIG_TS) ENDIF(WIN32) # Set build type here? May be useful for picking intelligent defaults @@ -156,13 +160,13 @@ # print out the title with a pretty box computed to wrap around SET(CONFIG_TITLE "*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build ${CONFIG_DATE} ***") -STRING(LENGTH ${CONFIG_TITLE_LENGTH} CONFIG_TITLE_LENGTH) +STRING(LENGTH ${CONFIG_TITLE} CONFIG_TITLE_LENGTH) SET(SEPARATOR_STRING "*") STRING(LENGTH ${SEPARATOR_STRING} SEPARATOR_STRING_LENGTH) -WHILE(CONFIG_TITLE_LENGTH > SEPARATOR_STRING_LENGTH) +WHILE(${CONFIG_TITLE_LENGTH} GREATER ${SEPARATOR_STRING_LENGTH}) SET(SEPARATOR_STRING "${SEPARATOR_STRING}*") STRING(LENGTH ${SEPARATOR_STRING} SEPARATOR_STRING_LENGTH) -ENDWHILE(CONFIG_TITLE_LENGTH > SEPARATOR_STRING_LENGTH) +ENDWHILE(${CONFIG_TITLE_LENGTH} GREATER ${SEPARATOR_STRING_LENGTH}) MESSAGE(STATUS "${SEPARATOR_STRING}") MESSAGE(STATUS "${CONFIG_TITLE}") MESSAGE(STATUS "${SEPARATOR_STRING}") @@ -263,14 +267,14 @@ MARK_AS_ADVANCED(BRLCAD-BUILD_RTSERVER_ONLY) # This is the top level control property for handling library building +set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING + "Set build type" FORCE) set_property(CACHE BRLCAD-BUILD_SRC_OTHER PROPERTY STRINGS "Yes" "No" "Auto") -set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING - "Set build type" FORCE) - # +INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR) BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL) @@ -291,7 +295,6 @@ # Now that all the tests are done, configure the brlcad_config.h file: -INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) configure_file(${CONFIG_H_FILE} ${BRLCAD_BINARY_DIR}/include/brlcad_config.h) #----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-05 04:27:15
|
Revision: 40011 http://brlcad.svn.sourceforge.net/brlcad/?rev=40011&view=rev Author: starseeker Date: 2010-08-05 04:27:08 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Use flex/bison find_package by default - will need to set up the other macros as non-flex/bison fallbacks. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-05 04:09:22 UTC (rev 40010) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-05 04:27:08 UTC (rev 40011) @@ -266,11 +266,20 @@ OPTION(BRLCAD-BUILD_RTSERVER_ONLY "Only build rtserver." OFF) MARK_AS_ADVANCED(BRLCAD-BUILD_RTSERVER_ONLY) +# Need to work on this - CMake can detect flex and bison, but apparently not +# generic lex/yacc - need to update the Wireshark files to be a a graceful +# fallback to the FLEX/BISON logic, and (perhaps) wrap both in some way to +# hide any differences from the build code? +find_package(FLEX) +find_package(BISON) +if (NOT FLEX_FOUND) + INCLUDE(${BRLCAD_CMAKE_DIR}/FindLEX.cmake) +endif (NOT FLEX_FOUND) +if (NOT BISON_FOUND) + INCLUDE(${BRLCAD_CMAKE_DIR}/FindYACC.cmake) +endif (NOT BISON_FOUND) -INCLUDE(${BRLCAD_CMAKE_DIR}/FindLEX.cmake) -INCLUDE(${BRLCAD_CMAKE_DIR}/FindYACC.cmake) - # This is the top level control property for handling library building set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING "Set build type" FORCE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-05 13:16:15
|
Revision: 40016 http://brlcad.svn.sourceforge.net/brlcad/?rev=40016&view=rev Author: starseeker Date: 2010-08-05 13:16:08 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Start looking for libraries Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-05 12:12:55 UTC (rev 40015) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-05 13:16:08 UTC (rev 40016) @@ -260,12 +260,16 @@ # macro to help with those cases. INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_Dependent_Options.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) + OPTION(BRLCAD-BUILD_BENCHMARK_ONLY "Only build benchmark." OFF) MARK_AS_ADVANCED(BRLCAD-BUILD_BENCHMARK_ONLY) OPTION(BRLCAD-BUILD_RTSERVER_ONLY "Only build rtserver." OFF) MARK_AS_ADVANCED(BRLCAD-BUILD_RTSERVER_ONLY) +INCLUDE (CheckLibraryExists) + # Need to work on this - CMake can detect flex and bison, but apparently not # generic lex/yacc - need to update the Wireshark files to be a a graceful # fallback to the FLEX/BISON logic, and (perhaps) wrap both in some way to @@ -279,14 +283,31 @@ INCLUDE(${BRLCAD_CMAKE_DIR}/FindYACC.cmake) endif (NOT BISON_FOUND) +# First, use CMake techniques for finding libraries that BRL-CAD +# doesn't supply locally +find_package(Threads) +# This may be overkill - does CHECK_LIBRARY_EXISTS usably set +# anything for us? +set(LIBBSD "") +CHECK_LIBRARY_EXISTS(bsd daemon "" HAVE_BSDDAEMON) +if (NOT HAVE_BSDDAEMON) + CHECK_LIBRARY_EXISTS(c daemon "" HAVE_CDAEMON) +endif (NOT HAVE_BSDDAEMON) +if (HAVE_BSDDAEMON) + set(LIBBSD "-lbsd") +endif (HAVE_BSDDAEMON) +if (HAVE_CDAEMON) + set(LIBBSD "-c") +endif (HAVE_CDAEMON) + + # This is the top level control property for handling library building set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING "Set build type" FORCE) set_property(CACHE BRLCAD-BUILD_SRC_OTHER PROPERTY STRINGS "Yes" "No" "Auto") -INCLUDE(${BRLCAD_CMAKE_DIR}/BRLCAD_ConfigFile.cmake) BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR) BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-05 13:41:51
|
Revision: 40017 http://brlcad.svn.sourceforge.net/brlcad/?rev=40017&view=rev Author: starseeker Date: 2010-08-05 13:41:44 +0000 (Thu, 05 Aug 2010) Log Message: ----------- Add in some more tests - this will need a LOT Of wiring up, cross platform testing, etc... Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-05 13:16:08 UTC (rev 40016) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-05 13:41:44 UTC (rev 40017) @@ -286,6 +286,9 @@ # First, use CMake techniques for finding libraries that BRL-CAD # doesn't supply locally find_package(Threads) +find_package(Curses) +find_package(X11) +find_package(OpenGL) # This may be overkill - does CHECK_LIBRARY_EXISTS usably set # anything for us? @@ -301,7 +304,43 @@ set(LIBBSD "-c") endif (HAVE_CDAEMON) +# rework this - check maybe should come after library +# is successfully found? +if(NOT WIN32) + CHECK_LIBRARY_EXISTS(m cos "" HAVE_MLIBRARY) + if(HAVE_MLIBRARY) + find_library(M_LIBRARY + NAMES m + PATHS /usr/lib /usr/local/lib + ) + endif() +else() + # not needed on windows + set(M_LIBRARY "") +endif() + +# once we decide how to handle the bsd daemon example, do the +# same thing for all of these: +CHECK_LIBRARY_EXISTS(socket socket "" HAVE_SOCKETLIB) +CHECK_LIBRARY_EXISTS(nsl gethostbyaddr "" HAVE_NSLIB) +CHECK_LIBRARY_EXISTS(network socket "" HAVE_NETWORKSOCKETLIB) +CHECK_LIBRARY_EXISTS(c malloc "" HAVE_MALLOC_LIB) + + +# Only look for frameworks if we're on an Apple machine - start +# with the example from the cmake wiki, but will very likely need +# fleshing out +if (APPLE) + INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon ) + FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices ) + FIND_LIBRARY(CARBON_LIBRARY Carbon) + FIND_LIBRARY(JAVAVM_LIBRARY JavaVM) + MARK_AS_ADVANCED (CARBON_LIBRARY + APP_SERVICES_LIBRARY) + SET(APPLE_LIBS ${CARBON_LIBRARY} ${JAVAVM_LIBRARY} ${APP_SERVICES_LIBRARY}) +endif (APPLE) + # This is the top level control property for handling library building set(BRLCAD-BUILD_SRC_OTHER "Auto" CACHE STRING "Set build type" FORCE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-06 03:10:59
|
Revision: 40020 http://brlcad.svn.sourceforge.net/brlcad/?rev=40020&view=rev Author: starseeker Date: 2010-08-06 03:10:52 +0000 (Fri, 06 Aug 2010) Log Message: ----------- whoops, do the right malloc check. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-06 02:23:11 UTC (rev 40019) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-06 03:10:52 UTC (rev 40020) @@ -325,7 +325,10 @@ CHECK_LIBRARY_EXISTS(socket socket "" HAVE_SOCKETLIB) CHECK_LIBRARY_EXISTS(nsl gethostbyaddr "" HAVE_NSLIB) CHECK_LIBRARY_EXISTS(network socket "" HAVE_NETWORKSOCKETLIB) -CHECK_LIBRARY_EXISTS(c malloc "" HAVE_MALLOC_LIB) +CHECK_LIBRARY_EXISTS(c mallopt "" HAVE_CMALLOC_LIB) +if (NOT HAVE_CMALLOC_LIB) + CHECK_LIBRARY_EXISTS(malloc mallopt "" HAVE_MALLOC_LIB) +endif (NOT HAVE_CMALLOC_LIB) # Only look for frameworks if we're on an Apple machine - start This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-06 19:00:25
|
Revision: 40023 http://brlcad.svn.sourceforge.net/brlcad/?rev=40023&view=rev Author: starseeker Date: 2010-08-06 19:00:18 +0000 (Fri, 06 Aug 2010) Log Message: ----------- Expand the tests for functions and headers. It looks like some of this should probably be handled by Find* files, but still figuring out how to approach this. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-06 15:42:26 UTC (rev 40022) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-06 19:00:18 UTC (rev 40023) @@ -291,7 +291,8 @@ INCLUDE(${BRLCAD_CMAKE_DIR}/FindGL.cmake) # This may be overkill - does CHECK_LIBRARY_EXISTS usably set -# anything for us? +# anything for us? May want to wrap some combination of +# CHECK_LIBRARY_EXISTS and FIND_LIBRARY into a macro... set(LIBBSD "") CHECK_LIBRARY_EXISTS(bsd daemon "" HAVE_BSDDAEMON) if (NOT HAVE_BSDDAEMON) @@ -305,7 +306,9 @@ endif (HAVE_CDAEMON) # rework this - check maybe should come after library -# is successfully found? +# is successfully found? Also, need to make sure +# paths used by CHECK_LIBRARY_EXISTS are reflected in +# find_library's PATHS list - see above macro comments... if(NOT WIN32) CHECK_LIBRARY_EXISTS(m cos "" HAVE_MLIBRARY) if(HAVE_MLIBRARY) @@ -329,8 +332,105 @@ if (NOT HAVE_CMALLOC_LIB) CHECK_LIBRARY_EXISTS(malloc mallopt "" HAVE_MALLOC_LIB) endif (NOT HAVE_CMALLOC_LIB) +CHECK_LIBRARY_EXISTS(mx matherr "" HAVE_LIBMX) +CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN) +CHECK_LIBRARY_EXISTS(l yyless "" HAVE_SOLARISLEXERLIB) +CHECK_LIBRARY_EXISTS(stdc++ main "" HAVE_STDCCXX) +# Some of these include should probably be handled by the Find* +# routines - currently this isn't quite a 1/1 match to the list +# in configure.ac and will probably change more - will also need to +# make sure local variations of the Find* routines do what is needed +# if CMake default Modules don't. +BRLCAD_INCLUDE_FILE(dslib.h HAVE_DSLIB_H) +BRLCAD_INCLUDE_FILE(getopt.h HAVE_GETOPT_H) +BRLCAD_INCLUDE_FILE(gl/device.h HAVE_GL_DEVICE_H) +BRLCAD_INCLUDE_FILE(grp.h HAVE_GRP_H) +BRLCAD_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H) +BRLCAD_INCLUDE_FILE(io.h HAVE_IO_H) +BRLCAD_INCLUDE_FILE(libgen.h HAVE_LIBGEN_H) +BRLCAD_INCLUDE_FILE(memory.h HAVE_MEMORY_H) +BRLCAD_INCLUDE_FILE(ncurses.h HAVE_NCURSES_H) +BRLCAD_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H) +BRLCAD_INCLUDE_FILE(poll.h HAVE_POLL_H) +BRLCAD_INCLUDE_FILE(pthread.h HAVE_PTHREAD) +BRLCAD_INCLUDE_FILE(pwd.h HAVE_PWD_H) +BRLCAD_INCLUDE_FILE(rle.h HAVE_RLE_H) +BRLCAD_INCLUDE_FILE(sched.h HAVE_SCHED_H) +BRLCAD_INCLUDE_FILE(sgtty.h HAVE_SGTTY_H) +BRLCAD_INCLUDE_FILE(stdint.h HAVE_STDINT_H) +BRLCAD_INCLUDE_FILE(sys/file.h HAVE_SYS_FILE_H) +BRLCAD_INCLUDE_FILE(sys/_ioctl.h HAVE_SYS__IOCTL_H) +BRLCAD_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) +BRLCAD_INCLUDE_FILE(sys/ioctl_compat.h HAVE_SYS_IOCTL_COMPAT_H) +BRLCAD_INCLUDE_FILE(sys/machd.h HAVE_SYS_MACHD_H) +BRLCAD_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H) +BRLCAD_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H) +BRLCAD_INCLUDE_FILE(sys/prctl.h HAVE_SYS_PRCTL_H) +BRLCAD_INCLUDE_FILE(sys/select.h HAVE_SYS_SELECT_H) +BRLCAD_INCLUDE_FILE(sys/socket.h HAVE_SYS_SOCKET_H) +BRLCAD_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) +BRLCAD_INCLUDE_FILE(sys/sysctl.h HAVE_SYS_SYSCTL_H) +BRLCAD_INCLUDE_FILE(sys/sysinfo.h HAVE_SYS_SYSINFO_H) +BRLCAD_INCLUDE_FILE(sys/sysmp.h HAVE_SYS_SYSMP_H) +BRLCAD_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H) +BRLCAD_INCLUDE_FILE(sys/times.h HAVE_SYS_TIMES_H) +BRLCAD_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H) +BRLCAD_INCLUDE_FILE(sys/un.h HAVE_SYS_UN_H) +BRLCAD_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H) +BRLCAD_INCLUDE_FILE(syslog.h HAVE_SYSLOG_H) +BRLCAD_INCLUDE_FILE(termcap.h HAVE_TERMCAP_H) +BRLCAD_INCLUDE_FILE(terminfo.h HAVE_TERMINFO_H) +BRLCAD_INCLUDE_FILE(termio.h HAVE_TERMIO_H) +BRLCAD_INCLUDE_FILE(termios.h HAVE_TERMIOS_H) +BRLCAD_INCLUDE_FILE(termlib.h HAVE_TERMLIB_H) +BRLCAD_INCLUDE_FILE(tinfo.h HAVE_TINFO_H) +BRLCAD_INCLUDE_FILE(ulocks.h HAVE_ULOCKS_H) +BRLCAD_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) +BRLCAD_INCLUDE_FILE(winsock.h HAVE_WINSOCK_H) +BRLCAD_FUNCTION_EXISTS(XQueryExtension HAVE_XQUERYEXTENSION) +BRLCAD_FUNCTION_EXISTS(alarm HAVE_ALARM) +BRLCAD_FUNCTION_EXISTS(dlopen HAVE_DLOPEN) +BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) +BRLCAD_FUNCTION_EXISTS(fchmod HAVE_FCHMOD) +BRLCAD_FUNCTION_EXISTS(fsync HAVE_FSYNC) +BRLCAD_FUNCTION_EXISTS(getegid HAVE_GETEGID) +BRLCAD_FUNCTION_EXISTS(geteuid HAVE_GETEUID) +BRLCAD_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME) +BRLCAD_FUNCTION_EXISTS(getloadavg HAVE_GETLOADAVG) +BRLCAD_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG) +BRLCAD_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME) +BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL) +BRLCAD_FUNCTION_EXISTS(lrand48 HAVE_LRAND48) +BRLCAD_FUNCTION_EXISTS(memset HAVE_MEMSET) +BRLCAD_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) +BRLCAD_FUNCTION_EXISTS(pipe HAVE_PIPE) +BRLCAD_FUNCTION_EXISTS(popen HAVE_POPEN) +BRLCAD_FUNCTION_EXISTS(random HAVE_RANDOM) +BRLCAD_FUNCTION_EXISTS(sbrk HAVE_SBRK) +BRLCAD_FUNCTION_EXISTS(setenv HAVE_SETENV) +BRLCAD_FUNCTION_EXISTS(setpgid HAVE_SETPGID) +BRLCAD_FUNCTION_EXISTS(setpriority HAVE_SETPRIORITY) +BRLCAD_FUNCTION_EXISTS(setprogname HAVE_SETPROGNAME) +BRLCAD_FUNCTION_EXISTS(srand48 HAVE__SRAND48) +BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR) +BRLCAD_FUNCTION_EXISTS(strdup HAVE_STRDUP) +BRLCAD_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) +BRLCAD_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) +BRLCAD_FUNCTION_EXISTS(strsep HAVE_STRSEP) +BRLCAD_FUNCTION_EXISTS(strtok HAVE_STRTOK) +BRLCAD_FUNCTION_EXISTS(sync HAVE_SYNC) +BRLCAD_FUNCTION_EXISTS(sysctl HAVE_SYSCTL) +BRLCAD_FUNCTION_EXISTS(sysmp HAVE_SYSMP) +BRLCAD_FUNCTION_EXISTS(vfork HAVE_VFORK) +BRLCAD_FUNCTION_EXISTS(writev HAVE_WRITEV) + +# Need to put TRY_RUN tests in foro basename and dirname - see configure.ac + +BRLCAD_TYPE_SIZE("ssize_t" SSIZE_T) + + # Only look for frameworks if we're on an Apple machine - start # with the example from the cmake wiki, but will very likely need # fleshing out @@ -345,18 +445,6 @@ set_property(CACHE BRLCAD-BUILD_SRC_OTHER PROPERTY STRINGS "Yes" "No" "Auto") -BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) -BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR) -BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL) -BRLCAD_INCLUDE_FILE(memory.h HAVE_MEMORY_H) -BRLCAD_INCLUDE_FILE(grp.h HAVE_GRP_H) -BRLCAD_INCLUDE_FILE(pthread.h HAVE_PTHREAD) -BRLCAD_INCLUDE_FILE(pwd.h HAVE_PWD_H) -BRLCAD_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) -BRLCAD_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H) -BRLCAD_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) -BRLCAD_TYPE_SIZE("ssize_t" SSIZE_T) - FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/COUNT "1") FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/DATE "1") FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/HOST "1") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-06 20:29:45
|
Revision: 40026 http://brlcad.svn.sourceforge.net/brlcad/?rev=40026&view=rev Author: starseeker Date: 2010-08-06 20:29:38 +0000 (Fri, 06 Aug 2010) Log Message: ----------- Gonna need to set the PNG options ahead of the ADD_SUBDIRECTORY call in the THIRD_PARTY macro unless we want to require two passes before building - has its drawbacks since if an external png lib is used these options are useless, but mark as advanced to hide them from casual site. Could be worse - it also highlights specific functionality needed by BRL-CAD. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-06 20:05:00 UTC (rev 40025) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-06 20:29:38 UTC (rev 40026) @@ -500,15 +500,17 @@ BRLCAD_THIRD_PARTY_OPTION(PNG libpng) SET(ZLIB_INCLUDE_DIR "${BRLCAD_ZLIB_INCLUDE_DIR}" CACHE STRING "Directory containing zlib headers" FORCE) SET(ZLIB_LIBRARY "${BRLCAD_ZLIB_LIBRARY}" CACHE STRING "zlib library" FORCE) +# BRL-CAD needs PNG's IO - turn it on (i.e. turn off the disabling flags) +SET(PNG_NO_CONSOLE_IO OFF CACHE BOOL "Option to disable Console IO in PNG" FORCE) +MARK_AS_ADVANCED(PNG_NO_CONSOLE_IO) +SET(PNG_NO_STDIO OFF CACHE BOOL "Option to disable STDIO in PNG" FORCE) +MARK_AS_ADVANCED(PNG_NO_STDIO) BRLCAD_THIRD_PARTY_SUBDIR(PNG src/other/libpng) IF(BRLCAD_USE_SYSTEM_LIBS) SET(BRLCAD_USE_SYSTEM_PNG ON CACHE BOOL "Use the system's libpng library" FORCE) ENDIF(BRLCAD_USE_SYSTEM_LIBS) IF(NOT BRLCAD_USE_SYSTEM_PNG) SET(BRLCAD_PNG_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/libpng" CACHE STRING "Directory containing libpng headers" FORCE) - # BRL-CAD needs PNG's IO - turn it on (i.e. turn off the disabling flags) - SET(PNG_NO_CONSOLE_IO OFF CACHE BOOL "Option to disable Console IO in PNG" FORCE) - SET(PNG_NO_STDIO OFF CACHE BOOL "Option to disable STDIO in PNG" FORCE) # PNG_LIB_NAME doesn't automatically propogate to toplevel due to scoping of CMake variables - # use get_directory_property to recover the value and place it in the CACHE get_directory_property(BRLCAD_PNG_LIB_NAME DIRECTORY src/other/libpng DEFINITION PNG_LIB_NAME) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-09 21:11:01
|
Revision: 40072 http://brlcad.svn.sourceforge.net/brlcad/?rev=40072&view=rev Author: starseeker Date: 2010-08-09 21:10:55 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Turn back on everything that seems to be building Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-09 21:06:43 UTC (rev 40071) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-09 21:10:55 UTC (rev 40072) @@ -598,16 +598,16 @@ # with multiple libraries. For now, just add it as a subdir ADD_SUBDIRECTORY(src/other/step) -#ADD_SUBDIRECTORY(src/libbu) -#ADD_SUBDIRECTORY(src/libbn) -#ADD_SUBDIRECTORY(src/libsysv) -#ADD_SUBDIRECTORY(src/librt) +ADD_SUBDIRECTORY(src/libbu) +ADD_SUBDIRECTORY(src/libbn) +ADD_SUBDIRECTORY(src/libsysv) +ADD_SUBDIRECTORY(src/librt) #ADD_SUBDIRECTORY(src/external) -#ADD_SUBDIRECTORY(src/libpkg) +ADD_SUBDIRECTORY(src/libpkg) #ADD_SUBDIRECTORY(src/libfb) -#ADD_SUBDIRECTORY(src/libwdb) -#ADD_SUBDIRECTORY(src/libgcv) -#ADD_SUBDIRECTORY(src/libanalyze) -#ADD_SUBDIRECTORY(src/libged) -#ADD_SUBDIRECTORY(src/liboptical) -#ADD_SUBDIRECTORY(src/liborle) +ADD_SUBDIRECTORY(src/libwdb) +ADD_SUBDIRECTORY(src/libgcv) +ADD_SUBDIRECTORY(src/libanalyze) +ADD_SUBDIRECTORY(src/libged) +ADD_SUBDIRECTORY(src/liboptical) +ADD_SUBDIRECTORY(src/liborle) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-09 21:13:31
|
Revision: 40073 http://brlcad.svn.sourceforge.net/brlcad/?rev=40073&view=rev Author: starseeker Date: 2010-08-09 21:13:25 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Oh yeah, better turn back on opennurbs too. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-09 21:10:55 UTC (rev 40072) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-09 21:13:25 UTC (rev 40073) @@ -580,19 +580,19 @@ #) # OpenNURBS Library -#BRLCAD_THIRD_PARTY_OPTION(OPENNURBS openNURBS) -#BRLCAD_THIRD_PARTY_SUBDIR(OPENNURBS src/other/openNURBS) -#IF(BRLCAD_USE_SYSTEM_LIBS) -# SET(BRLCAD_USE_SYSTEM_OPENNURBS ON CACHE BOOL "Use the system's openNURBS library" FORCE) -#ENDIF(BRLCAD_USE_SYSTEM_LIBS) -#IF(NOT BRLCAD_USE_SYSTEM_OPENNURBS) -# SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/openNURBS" CACHE STRING "Directory containing openNURBS headers" FORCE) -# SET(OPENNURBS_INCLUDE_DIR "${BRLCAD_OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) -# SET(BRLCAD_OPENNURBS_LIBRARY "openNURBS" CACHE STRING "openNURBS" FORCE) -#ELSE(NOT BRLCAD_USE_SYSTEM_OPENNURBS) -# SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) -# SET(BRLCAD_OPENNURBS_LIBRARY "${OPENNURBS_LIBRARY}" CACHE STRING "openNURBS library" FORCE) -#ENDIF(NOT BRLCAD_USE_SYSTEM_OPENNURBS) +BRLCAD_THIRD_PARTY_OPTION(OPENNURBS openNURBS) +BRLCAD_THIRD_PARTY_SUBDIR(OPENNURBS src/other/openNURBS) +IF(BRLCAD_USE_SYSTEM_LIBS) + SET(BRLCAD_USE_SYSTEM_OPENNURBS ON CACHE BOOL "Use the system's openNURBS library" FORCE) +ENDIF(BRLCAD_USE_SYSTEM_LIBS) +IF(NOT BRLCAD_USE_SYSTEM_OPENNURBS) + SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/openNURBS" CACHE STRING "Directory containing openNURBS headers" FORCE) + SET(OPENNURBS_INCLUDE_DIR "${BRLCAD_OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) + SET(BRLCAD_OPENNURBS_LIBRARY "openNURBS" CACHE STRING "openNURBS" FORCE) +ELSE(NOT BRLCAD_USE_SYSTEM_OPENNURBS) + SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) + SET(BRLCAD_OPENNURBS_LIBRARY "${OPENNURBS_LIBRARY}" CACHE STRING "openNURBS library" FORCE) +ENDIF(NOT BRLCAD_USE_SYSTEM_OPENNURBS) # STEP is going to require some extra thought - it's a src/other # with multiple libraries. For now, just add it as a subdir This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-10 00:29:17
|
Revision: 40074 http://brlcad.svn.sourceforge.net/brlcad/?rev=40074&view=rev Author: starseeker Date: 2010-08-10 00:29:10 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Get some fugly but functional regex logic in for Windows, and fix the if conditionals for the date CONFIG_TS Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-09 21:13:25 UTC (rev 40073) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-10 00:29:10 UTC (rev 40074) @@ -123,18 +123,17 @@ # Unfortunately, CMake doesn't give you variables with current day, month, -# etc. For Windows use d_rossberg's execute_process approach, which doesn't give individual -# day, month, etc. values but does give us something we can work with. Otherwise, +# etc. For Windows use d_rossberg's execute_process approach and some +# regular expressions (the resulting timestamp is not identical in format to +# that given by the Unix date command but is close) and for all other systems # use the date command. - -# TODO - figure out REGEX to get desired variables out of win32 string - IF(WIN32) execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE CONFIG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE CONFIG_TS OUTPUT_STRIP_TRAILING_WHITESPACE) -# SET(TMPSTR "Wed 08/04/2010") -# SET(TMPSTR2 "06:57 PM") - # STRING(REGEX REPLACE ... + execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE CONFIG_TIME OUTPUT_STRIP_TRAILING_WHITESPACE) + SET(CONFIG_TS "${CONFIG_DATE} ${CONFIG_TIME}") + STRING(REGEX REPLACE "[^0-9]*([0-9][0-9]).*" "\\1" CONFIG_MONTH "${CONFIG_DATE}" ) + STRING(REGEX REPLACE "[^0-9]*[0-9][0-9].([0-9][0-9]).*" "\\1" CONFIG_DAY "${CONFIG_DATE}" ) + STRING(REGEX REPLACE "[^0-9]*[0-9][0-9].[0-9][0-9].([0-9][0-9][0-9][0-9]).*" "\\1" CONFIG_YEAR "${CONFIG_DATE}" ) ELSE(WIN32) EXEC_PROGRAM(date ARGS +%d OUTPUT_VARIABLE CONFIG_DAY) EXEC_PROGRAM(date ARGS +%m OUTPUT_VARIABLE CONFIG_MONTH) @@ -142,12 +141,12 @@ SET(CONFIG_DATE "${CONFIG_YEAR}${CONFIG_MONTH}${CONFIG_DAY}") # try RFC 2822 for timestamp EXEC_PROGRAM(date ARGS -R 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) - IF (NOT CONFIG_TS) + IF ("${CONFIG_TS}" MATCHES ".*usage.*") EXEC_PROGRAM(date ARGS +'%a, %d %b %Y %H:%M:%S %z' 2>/dev/null OUTPUT_VARIABLE CONFIG_TS) - ENDIF(NOT CONFIG_TS) - IF (NOT CONFIG_TS) + ENDIF ("${CONFIG_TS}" MATCHES ".*usage.*") + IF ("${CONFIG_TS}" MATCHES ".*usage.*") EXEC_PROGRAM(date ARGS OUTPUT_VARIABLE CONFIG_TS) - ENDIF(NOT CONFIG_TS) + ENDIF ("${CONFIG_TS}" MATCHES ".*usage.*") ENDIF(WIN32) # Set build type here? May be useful for picking intelligent defaults @@ -445,7 +444,6 @@ FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/PATH "1") FILE(WRITE ${BRLCAD_SOURCE_DIR}/include/conf/USER "1") - # Now that all the tests are done, configure the brlcad_config.h file: configure_file(${CONFIG_H_FILE} ${BRLCAD_SOURCE_DIR}/include/brlcad_config.h) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-10 00:59:14
|
Revision: 40076 http://brlcad.svn.sourceforge.net/brlcad/?rev=40076&view=rev Author: starseeker Date: 2010-08-10 00:59:07 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Whoops - fix a couple minor issues with versioning. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-10 00:46:55 UTC (rev 40075) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-10 00:59:07 UTC (rev 40076) @@ -91,14 +91,14 @@ PROJECT(BRLCAD) # See HACKING for details on how to properly update the version -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR MAJOR_VERSION) -STRING(STRIP ${MAJOR_VERSION} MAJOR_VERSION) -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MINOR MINOR_VERSION) -STRING(STRIP ${MINOR_VERSION} MINOR_VERSION) -FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/PATCH PATCH_VERSION) -STRING(STRIP ${PATCH_VERSION} PATCH_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MAJOR BRLCAD_MAJOR_VERSION) +STRING(STRIP ${BRLCAD_MAJOR_VERSION} BRLCAD_MAJOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/MINOR BRLCAD_MINOR_VERSION) +STRING(STRIP ${BRLCAD_MINOR_VERSION} BRLCAD_MINOR_VERSION) +FILE(READ ${BRLCAD_SOURCE_DIR}/include/conf/PATCH BRLCAD_PATCH_VERSION) +STRING(STRIP ${BRLCAD_PATCH_VERSION} BRLCAD_PATCH_VERSION) -SET(CAD_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") +SET(CAD_VERSION "${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") SET(BRLCAD_VERSION "${CAD_VERSION}") # CMake derives much of its functionality from modules, typically @@ -171,7 +171,9 @@ # Set build type here? May be useful for picking intelligent defaults set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Basic" "Debug" "Release") -set(CMAKE_BUILD_TYPE "Basic" CACHE STRING "Set build type" FORCE) +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Basic" CACHE STRING "Set build type" FORCE) +endif (NOT CMAKE_BUILD_TYPE) # The location in which to install BRLCAD. What is this for Windows? # This would be a good setting to conditionalize based on a flag for debug @@ -179,7 +181,7 @@ IF(NOT BRLCAD_PREFIX) IF(NOT WIN32) IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release") - SET(BRLCAD_PREFIX "/usr/brlcad/brlcad-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") + SET(BRLCAD_PREFIX "/usr/brlcad/rel-${BRLCAD_MAJOR_VERSION}.${BRLCAD_MINOR_VERSION}.${BRLCAD_PATCH_VERSION}") ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Release") IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug") SET(BRLCAD_PREFIX "${BRLCAD_SOURCE_DIR}/../brlcad-install") @@ -187,6 +189,9 @@ IF ("${CMAKE_BUILD_TYPE}" MATCHES "Basic") SET(BRLCAD_PREFIX "/usr/brlcad") ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Basic") + if (NOT BRLCAD_PREFIX) + SET(BRLCAD_PREFIX "/usr/brlcad") + endif (NOT BRLCAD_PREFIX) ENDIF(NOT WIN32) ENDIF(NOT BRLCAD_PREFIX) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-10 01:42:47
|
Revision: 40079 http://brlcad.svn.sourceforge.net/brlcad/?rev=40079&view=rev Author: starseeker Date: 2010-08-10 01:42:41 +0000 (Tue, 10 Aug 2010) Log Message: ----------- More comment cleanup, start wrapping the find_package calls in option value if statements - needs testing to see if it works as expected. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-10 01:30:40 UTC (rev 40078) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-10 01:42:41 UTC (rev 40079) @@ -263,6 +263,15 @@ SET(CONFIG_H_FILE "${BRLCAD_BINARY_DIR}/include/brlcad_config.h.in") FILE(WRITE ${CONFIG_H_FILE} "/**** Define statements for CMake ****/\n") + +# CMake can detect flex and bison, but apparently not generic lex/yacc. +# Solution is to make our own generic lex/yacc Find routines that look +# first for flex/bison, but will take whatever's available. Since the +# BRL-CAD project isn't supposed to rely on flex/bison specific features +# anyway, there shouldn't be a problem. +INCLUDE(${BRLCAD_CMAKE_DIR}/FindLEX.cmake) +INCLUDE(${BRLCAD_CMAKE_DIR}/FindYACC.cmake) + #-------------------------------------------------------------------------------- # Now we define the various options for BRL-CAD things the user can enable and # disable. As much as possible, autodetect sane default options. @@ -280,22 +289,28 @@ OPTION(BRLCAD-BUILD_RTSERVER_ONLY "Only build rtserver." OFF) MARK_AS_ADVANCED(BRLCAD-BUILD_RTSERVER_ONLY) -INCLUDE (CheckLibraryExists) -# Need to work on this - CMake can detect flex and bison, but apparently not -# generic lex/yacc - need to update the Wireshark files to be a a graceful -# fallback to the FLEX/BISON logic, and (perhaps) wrap both in some way to -# hide any differences from the build code? -INCLUDE(${BRLCAD_CMAKE_DIR}/FindLEX.cmake) -INCLUDE(${BRLCAD_CMAKE_DIR}/FindYACC.cmake) +# Use CMake techniques for finding libraries that BRL-CAD +# doesn't supply locally, but pay attention to which options +# are enabled -# First, use CMake techniques for finding libraries that BRL-CAD -# doesn't supply locally find_package(Threads) find_package(Curses) -find_package(X11) -INCLUDE(${BRLCAD_CMAKE_DIR}/FindGL.cmake) +if(WIN32 OR APPLE) + OPTION(BRLCAD-ENABLE_X11 "Use X11." OFF) +endif(WIN32 OR APPLE) +if (BRLCAD-ENABLE_X11) + find_package(X11) +endif (BRLCAD-ENABLE_X11) + +OPTION(BRLCAD-ENABLE_OPENGL "Use OpenGL." ON) +if (BRLCAD-ENABLE_OPENGL) + INCLUDE(${BRLCAD_CMAKE_DIR}/FindGL.cmake) +endif (BRLCAD-ENABLE_OPENGL) + +INCLUDE (CheckLibraryExists) + # This may be overkill - does CHECK_LIBRARY_EXISTS usably set # anything for us? May want to wrap some combination of # CHECK_LIBRARY_EXISTS and FIND_LIBRARY into a macro... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sta...@us...> - 2010-08-10 18:54:43
|
Revision: 40089 http://brlcad.svn.sourceforge.net/brlcad/?rev=40089&view=rev Author: starseeker Date: 2010-08-10 18:54:37 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Write more values into the config file. Modified Paths: -------------- brlcad/branches/cmake/CMakeLists.txt Modified: brlcad/branches/cmake/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/CMakeLists.txt 2010-08-10 18:47:59 UTC (rev 40088) +++ brlcad/branches/cmake/CMakeLists.txt 2010-08-10 18:54:37 UTC (rev 40089) @@ -242,6 +242,15 @@ SET(BRLCAD_INSTALL_PACKAGE_DIR ${BRLCAD_INSTALL_LIB_DIR}) ENDIF(NOT BRLCAD_INSTALL_PACKAGE_DIR) +# The location in which to install BRL-CAD data files +IF(NOT BRLCAD_INSTALL_DATA_DIR) + IF (${BRLCAD_PREFIX} MATCHES "^/usr[/]*$" OR ${BRLCAD_PREFIX} MATCHES "^/usr/local[/]*$") + SET(BRLCAD_INSTALL_DATA_DIR ${BRLCAD_PREFIX}/share/brlcad) + ELSE() + SET(BRLCAD_INSTALL_DATA_DIR ${BRLCAD_PREFIX}/share) + ENDIF() +ENDIF(NOT BRLCAD_INSTALL_DATA_DIR) + # The location in which to install BRL-CAD documentation files IF(NOT BRLCAD_INSTALL_DOC_DIR) SET(BRLCAD_INSTALL_DOC_DIR ${BRLCAD_PREFIX}/share/brlcad/doc) @@ -263,7 +272,21 @@ SET(CONFIG_H_FILE "${BRLCAD_BINARY_DIR}/include/brlcad_config.h.in") FILE(WRITE ${CONFIG_H_FILE} "/**** Define statements for CMake ****/\n") +# Set up some of the define statements for path information and other basics +FILE(APPEND ${CONFIG_H_FILE} "#define PACKAGE \"brlcad\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define PACKAGE_BUGREPORT \"http://brlcad.org\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define PACKAGE_NAME \"BRL-CAD\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define PACKAGE_STRING \"BRL-CAD ${BRLCAD_VERSION}\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define PACKAGE_TARNAME \"brlcad\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define BRLCAD_DATA \"${BRLCAD_INSTALL_DATA_DIR}\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define BRLCAD_ROOT \"${BRLCAD_PREFIX}\"\n") +FILE(APPEND ${CONFIG_H_FILE} "#define VERSION \"${BRLCAD_VERSION}\"\n") +IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug") + FILE(APPEND ${CONFIG_H_FILE} "#define DEBUG 1\n") +ENDIF() + + # CMake can detect flex and bison, but apparently not generic lex/yacc. # Solution is to make our own generic lex/yacc Find routines that look # first for flex/bison, but will take whatever's available. Since the @@ -276,6 +299,19 @@ # Now we define the various options for BRL-CAD things the user can enable and # disable. As much as possible, autodetect sane default options. +OPTION(BRLCAD-ENABLE_STRICT "Use strict compiler settings" OFF) +if (BRLCAD-ENABLE_STRICT) + FILE(APPEND ${CONFIG_H_FILE} "#define STRICT_FLAGS 1\n") +endif (BRLCAD-ENABLE_STRICT) + +OPTION(BRLCAD-ENABLE_SMP "Enable SMP architecture parallel computation support" OFF) +MARK_AS_ADVANCED(BRLCAD-ENABLE_SMP) +if (BRLCAD-ENABLE_SMP) + FILE(APPEND ${CONFIG_H_FILE} "#define PARALLEL 1\n") +endif (BRLCAD-ENABLE_SMP) + + + # Sometimes an option no longer makes sense in light of other options, # or a new option becomes available when others are enabled - load a # macro to help with those cases. @@ -296,6 +332,9 @@ find_package(Threads) find_package(Curses) +if (CURSES_HAVE_CURSES_H) + FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_CURSES_H 1\n") +endif() if(WIN32 OR APPLE) OPTION(BRLCAD-ENABLE_X11 "Use X11." OFF) @@ -363,7 +402,9 @@ # in configure.ac and will probably change more - will also need to # make sure local variations of the Find* routines do what is needed # if CMake default Modules don't. +BRLCAD_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H) BRLCAD_INCLUDE_FILE(dslib.h HAVE_DSLIB_H) +BRLCAD_INCLUDE_FILE(dirent.h HAVE_DIRENT_H) BRLCAD_INCLUDE_FILE(getopt.h HAVE_GETOPT_H) BRLCAD_INCLUDE_FILE(gl/device.h HAVE_GL_DEVICE_H) BRLCAD_INCLUDE_FILE(grp.h HAVE_GRP_H) @@ -412,6 +453,7 @@ BRLCAD_FUNCTION_EXISTS(XQueryExtension HAVE_XQUERYEXTENSION) BRLCAD_FUNCTION_EXISTS(alarm HAVE_ALARM) +BRLCAD_FUNCTION_EXISTS(alloca HAVE_ALLOCA) BRLCAD_FUNCTION_EXISTS(dlopen HAVE_DLOPEN) BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48) BRLCAD_FUNCTION_EXISTS(fchmod HAVE_FCHMOD) @@ -447,11 +489,51 @@ BRLCAD_FUNCTION_EXISTS(vfork HAVE_VFORK) BRLCAD_FUNCTION_EXISTS(writev HAVE_WRITEV) -# Need to put TRY_RUN tests in foro basename and dirname - see configure.ac BRLCAD_TYPE_SIZE("ssize_t" SSIZE_T) +INCLUDE(CheckCSourceRuns) + +# Check for basename and dirname +CHECK_LIBRARY_EXISTS(gen basename "" HAVE_LIBGEN) +if(HAVE_LIBGEN) +SET(basename_SRC " +#include <libgen.h> +int main(int argc, char *argv[]) { + (void)basename(argv[0]); + return 0; +}") +SET(dirname_SRC " +#include <libgen.h> +int main(int argc, char *argv[]) { + (void)dirname(argv[0]); + return 0; +}") +ELSE(HAVE_LIBGEN_H) +SET(basename_SRC " +int main(int argc, char *argv[]) { + (void)basename(argv[0]); + return 0; +}") +SET(dirname_SRC " +int main(int argc, char *argv[]) { + (void)dirname(argv[0]); + return 0; +}") +ENDIF(HAVE_LIBGEN) + +CHECK_C_SOURCE_RUNS("${basename_SRC}" HAVE_BASENAME) +CHECK_C_SOURCE_RUNS("${dirname_SRC}" HAVE_DIRNAME) +if (HAVE_BASENAME) + FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_BASENAME 1\n") +endif() +if (HAVE_DIRNAME) + FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_DIRNAME 1\n") +endif() + + + # Only look for frameworks if we're on an Apple machine - start # with the example from the cmake wiki, but will very likely need # fleshing out @@ -615,6 +697,7 @@ SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/openNURBS" CACHE STRING "Directory containing openNURBS headers" FORCE) SET(OPENNURBS_INCLUDE_DIR "${BRLCAD_OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) SET(BRLCAD_OPENNURBS_LIBRARY "openNURBS" CACHE STRING "openNURBS" FORCE) + BRLCAD_INCLUDE_FILE(emmintrin.h HAVE_EMMINTRIN_H) ELSE(NOT BRLCAD_USE_SYSTEM_OPENNURBS) SET(BRLCAD_OPENNURBS_INCLUDE_DIR "${OPENNURBS_INCLUDE_DIR}" CACHE STRING "Directory containing openNURBS headers" FORCE) SET(BRLCAD_OPENNURBS_LIBRARY "${OPENNURBS_LIBRARY}" CACHE STRING "openNURBS library" FORCE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |