<commit_before>cmake_minimum_required(VERSION 2.8.6) # for UseJava.cmake

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# set up pods
set(POD_NAME drake)
include(cmake/pods.cmake)

option(BUILD_SHARED_LIBS "Build Drake with shared libraries." ON)
# set up Java, use a target of 1.6
find_package(Java REQUIRED)
include(UseJava)
set(CMAKE_JAVA_COMPILE_FLAGS ${CMAKE_JAVA_COMPILE_FLAGS} -source 6 -target 6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wreturn-type -Wuninitialized -Wunused-variable") # -Wunused-parameter")

if (CMAKE_COMPILER_IS_GNUCC)
   execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
                OUTPUT_VARIABLE GCC_VERSION)
   if (NOT (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3))
        message(FATAL_ERROR "requires gcc version >= 4.3")  # to support the c++0x flag below
   elseif(GCC_VERSION VERSION_LESS 4.7)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   else()
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 if (APPLE)  # this was a step towards getting things to work with
#   clang on mac, but ultimately we didn't get there...   (but I would
#   be worried about sharing pointers between objects compiled against
#   different c++ libs, so removing it)
#    # http://stackoverflow.com/questions/13445742/apple-and-shared-ptr
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")  
  endif()
endif()

# set up matlab build
include(cmake/mex.cmake)


# set up and build lcm types
include(cmake/lcmtypes.cmake)
#add_subdirectory(lcmtypes)
lcmtypes_build()

set(drake_jar_javafiles util/Transform.java)
set(drake_jar_requires)

if (LCM_FOUND)
  pods_use_pkg_config_classpath(lcm-java)

  # annoyingly, libbot does not define a classpath variable. there might be a cleaner way to do this
  execute_process(COMMAND pkg-config --variable=prefix bot2-lcmgl-client OUTPUT_VARIABLE LCMGL_BUILD_DIR)
  if (NOT LCMGL_BUILD_DIR)
     message(FATAL_ERROR "\n\n----- ERROR: bot2-lcmgl not found")
  endif()
  string(STRIP ${LCMGL_BUILD_DIR} LCMGL_BUILD_DIR)
  find_jar(LCMGL_JAR_FILE bot2-lcmgl
  		PATHS "${LCMGL_BUILD_DIR}/share/java/")
  if (NOT LCMGL_JAR_FILE)
     message(FATAL_ERROR "\n\n----- ERROR: bot2-lcmgl not found")
  else()
     message(STATUS "Found bot2-lcmgl")
  endif()
  set(CMAKE_JAVA_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}:${LCMGL_JAR_FILE})

  list(APPEND drake_jar_javafiles 
        util/MyLCMTypeDatabase.java
	util/MessageMonitor.java
	util/CoordinateFrameData.java
	util/LCMCoder.java
 	util/BotLCMGLClient.java
	)
  list(APPEND drake_jar_requires lcm-java lcmtypes_drake-java)
endif()

add_jar(drake ${drake_jar_javafiles})
install_jar(drake share/java)
pods_install_pkg_config_file(drake-java
    CLASSPATH drake
    REQUIRES ${drake_jar_requires}
    VERSION 0.0.1)
<commit_msg>support having lcm without having lcmgl<commit_after>cmake_minimum_required(VERSION 2.8.6) # for UseJava.cmake

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# set up pods
set(POD_NAME drake)
include(cmake/pods.cmake)

option(BUILD_SHARED_LIBS "Build Drake with shared libraries." ON)
# set up Java, use a target of 1.6
find_package(Java REQUIRED)
include(UseJava)
set(CMAKE_JAVA_COMPILE_FLAGS ${CMAKE_JAVA_COMPILE_FLAGS} -source 6 -target 6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wreturn-type -Wuninitialized -Wunused-variable") # -Wunused-parameter")

if (CMAKE_COMPILER_IS_GNUCC)
   execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
                OUTPUT_VARIABLE GCC_VERSION)
   if (NOT (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3))
        message(FATAL_ERROR "requires gcc version >= 4.3")  # to support the c++0x flag below
   elseif(GCC_VERSION VERSION_LESS 4.7)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   else()
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 if (APPLE)  # this was a step towards getting things to work with
#   clang on mac, but ultimately we didn't get there...   (but I would
#   be worried about sharing pointers between objects compiled against
#   different c++ libs, so removing it)
#    # http://stackoverflow.com/questions/13445742/apple-and-shared-ptr
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")  
  endif()
endif()

# set up matlab build
include(cmake/mex.cmake)


# set up and build lcm types
include(cmake/lcmtypes.cmake)
#add_subdirectory(lcmtypes)
lcmtypes_build()

set(drake_jar_javafiles util/Transform.java)
set(drake_jar_requires)

if (LCM_FOUND)
  pods_use_pkg_config_classpath(lcm-java)

  list(APPEND drake_jar_javafiles 
        util/MyLCMTypeDatabase.java
	util/MessageMonitor.java
	util/CoordinateFrameData.java
	util/LCMCoder.java
	)
  list(APPEND drake_jar_requires lcm-java lcmtypes_drake-java)

  # add lcmgl
  # annoyingly, libbot does not define a classpath variable. there might be a cleaner way to do this
  execute_process(COMMAND pkg-config --variable=prefix bot2-lcmgl-client OUTPUT_VARIABLE LCMGL_BUILD_DIR)
  if (NOT LCMGL_BUILD_DIR)
     message(WARNING "\n\n----- ERROR: bot2-lcmgl not found")
  else ()
    string(STRIP ${LCMGL_BUILD_DIR} LCMGL_BUILD_DIR)
    find_jar(LCMGL_JAR_FILE bot2-lcmgl
  		PATHS "${LCMGL_BUILD_DIR}/share/java/")
    if (NOT LCMGL_JAR_FILE)
       message(FATAL_ERROR "\n\n----- ERROR: bot2-lcmgl not found")
    else()
       message(STATUS "Found bot2-lcmgl")
    endif()
    set(CMAKE_JAVA_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}:${LCMGL_JAR_FILE})
    list(APPEND drake_jar_javafiles 
 	util/BotLCMGLClient.java
	)
  endif()

endif()

add_jar(drake ${drake_jar_javafiles})
install_jar(drake share/java)
pods_install_pkg_config_file(drake-java
    CLASSPATH drake
    REQUIRES ${drake_jar_requires}
    VERSION 0.0.1)

{'fraction_non_alphanumeric': 0.10606824676416204, 'fraction_numerical': 0.012439065389141033, 'mean_word_length': 4.896927651139742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4758763', 'n_tokens_mistral': 2406, 'n_tokens_neox': 2257, 'n_words': 474}