#Specify the version being used aswell as the language cmake_minimum_required(VERSION 2.8.11) #Name your project here project(shview) #set the module directory set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") #build the executable in the binary directory on MS Visual Studio if ( MSVC ) SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}") SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}") SET( LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}") SET( LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}") add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_SCL_SECURE_NO_WARNINGS) endif ( MSVC ) #find the STIM library find_package(STIM REQUIRED) find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) #find BOOST find_package(Boost REQUIRED) #find the pthreads package find_package(Threads) include_directories( ${STIM_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR} ${OpenGL_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ) #Assign source files to the appropriate variables file(GLOB SRC_CPP "*.cpp") file(GLOB SRC_H "*.h") #create an executable file add_executable(shview ${SRC_H} ${SRC_CPP} ) #set the link libraries target_link_libraries(shview ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )