Files
allwpilib/wpilibc/wpilibC++Sim/CMakeLists.txt
peter mitrano 29d029fa61 merged from frcsim branch
verified to work on real robots
adds sim eclipse plugins, fixed JavaGazebo, made wpilibC++Sim build on windows
 - Java and C++ simulation robot programs run on windows
 - simulation eclipse plugin delivers models and gazebo plugins
 - Java Gazebo now respects GAZEBO_IP variables and can work across networks
 - hal and network tables win32 hacked to work on windows
 - smart dashboard broken on windows due to network tables hacks
 - wpilibC++Sim, gz_msgs, and frcsim_gazebo_plugins build with CMake
 - removed constexpr for cross platform compatibility
 - msgs generated using .protos as a part of build process
 - some spare and unused cmake/pom files deleted
 - simulation ubuntu debians removed entirely
 - refactored CMake project flags and macros
 - updated to match non-sim C++ API
 - fixed and updated documentation
 - servo added to simulation

Change-Id: Ia702ff0f1fee10d77f543810ad88f56696443b05
2015-08-18 10:39:25 -04:00

71 lines
2.0 KiB
CMake

cmake_minimum_required(VERSION 2.8)
project(WPILibSim)
if (WIN32)
#temporary until we build dlls
add_definitions(-DBUILDING_STATIC_LIBS)
# XXX: should be set via CMake variables in configure.bat
set(PTHREAD_INCLUDE_DIR "C:/Users/peter/gz-ws/pthread-w32/include")
set(PTHREAD_LIBRARY "C:/Users/peter/gz-ws/pthread-w32/libs/x64/pthreadVC2.lib")
endif()
get_filename_component(HAL_API_INCLUDES ../../hal/include REALPATH)
get_filename_component(NWT_API_INCLUDES ../../networktables/cpp/include REALPATH)
# also on windows use sprintf_s instead of snprintf
# TODO: find a more permenenant solution
if (WIN32)
add_definitions(-Dsnprintf=sprintf_s)
endif()
if (WIN32)
file(GLOB_RECURSE SRC_FILES src/*.cpp
../../networktables/cpp/lib/share/*.cpp
../../networktables/cpp/lib/WIN32/*.cpp)
else()
file(GLOB_RECURSE SRC_FILES src/*.cpp
../../networktables/cpp/lib/share/*.cpp
../../networktables/cpp/lib/Athena/*.cpp)
endif()
file(GLOB_RECURSE COM_SRC_FILES ../wpilibC++/src/*.cpp)
set (INCLUDE_FOLDERS include
../wpilibC++/include
../../networktables/cpp/include
../../hal/include
${GZ_MSGS_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${GAZEBO_INCLUDE_DIRS})
if (WIN32)
#these paths will be fixed when a more permenant windows development solution is found
set(INCLUDE_FOLDERS ${INCLUDE_FOLDERS}
C:/Users/peter/gz-ws/protobuf-2.6.0-win64-vc12/src
C:/Users/peter/gz-ws/sdformat/src/win/tinyxml
C:/Users/peter/gz-ws/FreeImage-vc12-x64-release-debug/Source
C:/Users/peter/gz-ws/tbb43_20141023oss/include
${PTHREAD_INCLUDE_DIR})
endif()
include_directories(${INCLUDE_FOLDERS})
link_directories(${GAZEBO_LIBRARY_DIRS})
if (WIN32)
add_library(WPILibSim ${SRC_FILES} ${COM_SRC_FILES})
else()
add_library(WPILibSim SHARED ${SRC_FILES} ${COM_SRC_FILES})
endif()
target_link_libraries(WPILibSim gz_msgs ${PTHREAD_LIBRARY} ${Boost_LIBRARIES} ${GAZEBO_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -fPIC) # NetworkTables
if (WIN32)
set_target_properties(${project} PROPERTIES LINK_FLAGS "/DEBUG")
endif()
#copy to eclipse plugin