#------------------------------------- # Install the executable or files to 'bin' directory # under CMAKE_INSTALL_PREFIX # install(TARGETS ${PROJ_NAME} DESTINATION bin)
问题描述
如何外部编译 ?
1 2 3 4 5 6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/lib cd build cmake -DCMAKE_INSTALL_PREFIX=../ ../ make -j4 make install cd ../bin
#---------------------------------------------------------------------------- # Setup Geant4 include directories and compile definitions # Setup include directory for this project # include_directories(${PROJECT_SOURCE_DIR}/inc)
#---------------------------------------------------------------------------- # Locate sources and headers for this project # NB: headers are included so they will show up in IDEs # file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) file(GLOB headers ${PROJECT_SOURCE_DIR}/inc/*.hh)
#------------------------------------------- # Create static and dynamic library # add_library(${PROJ_NAME} SHARED ${sources} ${headers}) set_target_properties(${PROJ_NAME} PROPERTIES VERSION 1.2 SOVERSION 1)
#---------------------------------------------------------------------------- # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX # #install(TARGETS ${PROJ_NAME} DESTINATION lib) #install(FILES ${headers} DESTINATION inc) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}../../../lib)