mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
This is a major restructuring of the WPILib repository to simply build procedures and remove the remnants of Maven from everything except the eclipse plugins. Gradle files have been largely simplified or rewritten, taking advantage of splitting up parts of the build into separate build files for ease of reading. The eclipse plugins are now in a separate project, as is ntcore. All dependencies are resolved via Maven dependencies, with the Jenkins-maintained WPILib repo. Project structures have also been simplified: we no longer have separate subprojects inside wpilibc and wpilibj. Where possible, these changes hav been done with git renames, to make sure we still have full history for all repositories. Other unrelated subprojects have also been broken out: OutlineViewer is now a separate project. Change-Id: Ib4e2a6e1a2f66427a14f16612b0e0d69ed661878
61 lines
1.8 KiB
CMake
61 lines
1.8 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()
|
|
|
|
file(GLOB_RECURSE COM_SRC_FILES ../wpilibC++/src/*.cpp)
|
|
|
|
|
|
set (INCLUDE_FOLDERS include
|
|
../wpilibC++/include
|
|
../../networktables/ntcore/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 ntcore ${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
|